1#![doc = "MAVLink AVSSUAS dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#[cfg(feature = "arbitrary")]
5use arbitrary::Arbitrary;
6#[allow(unused_imports)]
7use bitflags::bitflags;
8use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
9#[allow(unused_imports)]
10use num_derive::FromPrimitive;
11#[allow(unused_imports)]
12use num_derive::ToPrimitive;
13#[allow(unused_imports)]
14use num_traits::FromPrimitive;
15#[allow(unused_imports)]
16use num_traits::ToPrimitive;
17#[cfg(feature = "serde")]
18use serde::{Deserialize, Serialize};
19#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
20#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21#[cfg_attr(feature = "serde", serde(tag = "type"))]
22#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23#[repr(u32)]
24#[doc = "Indicates the ESC connection type."]
25pub enum EscConnectionType {
26 #[doc = "Traditional PPM ESC."]
27 ESC_CONNECTION_TYPE_PPM = 0,
28 #[doc = "Serial Bus connected ESC."]
29 ESC_CONNECTION_TYPE_SERIAL = 1,
30 #[doc = "One Shot PPM ESC."]
31 ESC_CONNECTION_TYPE_ONESHOT = 2,
32 #[doc = "I2C ESC."]
33 ESC_CONNECTION_TYPE_I2C = 3,
34 #[doc = "CAN-Bus ESC."]
35 ESC_CONNECTION_TYPE_CAN = 4,
36 #[doc = "DShot ESC."]
37 ESC_CONNECTION_TYPE_DSHOT = 5,
38}
39impl EscConnectionType {
40 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
41}
42impl Default for EscConnectionType {
43 fn default() -> Self {
44 Self::DEFAULT
45 }
46}
47#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
48#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
49#[cfg_attr(feature = "serde", serde(tag = "type"))]
50#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
51#[repr(u32)]
52#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
53pub enum MavStandardMode {
54 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
55 MAV_STANDARD_MODE_NON_STANDARD = 0,
56 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
57 MAV_STANDARD_MODE_POSITION_HOLD = 1,
58 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
59 MAV_STANDARD_MODE_ORBIT = 2,
60 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
61 MAV_STANDARD_MODE_CRUISE = 3,
62 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
63 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
64 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
65 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
66 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
67 MAV_STANDARD_MODE_MISSION = 6,
68 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
69 MAV_STANDARD_MODE_LAND = 7,
70 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
71 MAV_STANDARD_MODE_TAKEOFF = 8,
72}
73impl MavStandardMode {
74 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
75}
76impl Default for MavStandardMode {
77 fn default() -> Self {
78 Self::DEFAULT
79 }
80}
81#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
82#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
83#[cfg_attr(feature = "serde", serde(tag = "type"))]
84#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
85#[repr(u32)]
86pub enum MavOdidCategoryEu {
87 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
88 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
89 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
90 MAV_ODID_CATEGORY_EU_OPEN = 1,
91 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
92 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
93 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
94 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
95}
96impl MavOdidCategoryEu {
97 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
98}
99impl Default for MavOdidCategoryEu {
100 fn default() -> Self {
101 Self::DEFAULT
102 }
103}
104#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
105#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
106#[cfg_attr(feature = "serde", serde(tag = "type"))]
107#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
108#[repr(u32)]
109#[doc = "Generalized UAVCAN node health"]
110pub enum UavcanNodeHealth {
111 #[doc = "The node is functioning properly."]
112 UAVCAN_NODE_HEALTH_OK = 0,
113 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
114 UAVCAN_NODE_HEALTH_WARNING = 1,
115 #[doc = "The node has encountered a major failure."]
116 UAVCAN_NODE_HEALTH_ERROR = 2,
117 #[doc = "The node has suffered a fatal malfunction."]
118 UAVCAN_NODE_HEALTH_CRITICAL = 3,
119}
120impl UavcanNodeHealth {
121 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
122}
123impl Default for UavcanNodeHealth {
124 fn default() -> Self {
125 Self::DEFAULT
126 }
127}
128#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
129#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
130#[cfg_attr(feature = "serde", serde(tag = "type"))]
131#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
132#[repr(u32)]
133#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
134pub enum MissionState {
135 #[doc = "The mission status reporting is not supported."]
136 MISSION_STATE_UNKNOWN = 0,
137 #[doc = "No mission on the vehicle."]
138 MISSION_STATE_NO_MISSION = 1,
139 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
140 MISSION_STATE_NOT_STARTED = 2,
141 #[doc = "Mission is active, and will execute mission items when in auto mode."]
142 MISSION_STATE_ACTIVE = 3,
143 #[doc = "Mission is paused when in auto mode."]
144 MISSION_STATE_PAUSED = 4,
145 #[doc = "Mission has executed all mission items."]
146 MISSION_STATE_COMPLETE = 5,
147}
148impl MissionState {
149 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
150}
151impl Default for MissionState {
152 fn default() -> Self {
153 Self::DEFAULT
154 }
155}
156bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
157impl PositionTargetTypemask {
158 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
159}
160impl Default for PositionTargetTypemask {
161 fn default() -> Self {
162 Self::DEFAULT
163 }
164}
165bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
166impl MavSysStatusSensorExtended {
167 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
168}
169impl Default for MavSysStatusSensorExtended {
170 fn default() -> Self {
171 Self::DEFAULT
172 }
173}
174#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
175#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
176#[cfg_attr(feature = "serde", serde(tag = "type"))]
177#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
178#[repr(u32)]
179#[doc = "Type of mission items being requested/sent in mission protocol."]
180pub enum MavMissionType {
181 #[doc = "Items are mission commands for main mission."]
182 MAV_MISSION_TYPE_MISSION = 0,
183 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
184 MAV_MISSION_TYPE_FENCE = 1,
185 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
186 MAV_MISSION_TYPE_RALLY = 2,
187 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
188 MAV_MISSION_TYPE_ALL = 255,
189}
190impl MavMissionType {
191 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
192}
193impl Default for MavMissionType {
194 fn default() -> Self {
195 Self::DEFAULT
196 }
197}
198#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
199#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
200#[cfg_attr(feature = "serde", serde(tag = "type"))]
201#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
202#[repr(u32)]
203#[doc = "Possible actions an aircraft can take to avoid a collision."]
204pub enum MavCollisionAction {
205 #[doc = "Ignore any potential collisions"]
206 MAV_COLLISION_ACTION_NONE = 0,
207 #[doc = "Report potential collision"]
208 MAV_COLLISION_ACTION_REPORT = 1,
209 #[doc = "Ascend or Descend to avoid threat"]
210 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
211 #[doc = "Move horizontally to avoid threat"]
212 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
213 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
214 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
215 #[doc = "Aircraft to fly directly back to its launch point"]
216 MAV_COLLISION_ACTION_RTL = 5,
217 #[doc = "Aircraft to stop in place"]
218 MAV_COLLISION_ACTION_HOVER = 6,
219}
220impl MavCollisionAction {
221 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
222}
223impl Default for MavCollisionAction {
224 fn default() -> Self {
225 Self::DEFAULT
226 }
227}
228#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
229#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
230#[cfg_attr(feature = "serde", serde(tag = "type"))]
231#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
232#[repr(u32)]
233#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
234pub enum AisNavStatus {
235 #[doc = "Under way using engine."]
236 UNDER_WAY = 0,
237 AIS_NAV_ANCHORED = 1,
238 AIS_NAV_UN_COMMANDED = 2,
239 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
240 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
241 AIS_NAV_MOORED = 5,
242 AIS_NAV_AGROUND = 6,
243 AIS_NAV_FISHING = 7,
244 AIS_NAV_SAILING = 8,
245 AIS_NAV_RESERVED_HSC = 9,
246 AIS_NAV_RESERVED_WIG = 10,
247 AIS_NAV_RESERVED_1 = 11,
248 AIS_NAV_RESERVED_2 = 12,
249 AIS_NAV_RESERVED_3 = 13,
250 #[doc = "Search And Rescue Transponder."]
251 AIS_NAV_AIS_SART = 14,
252 #[doc = "Not available (default)."]
253 AIS_NAV_UNKNOWN = 15,
254}
255impl AisNavStatus {
256 pub const DEFAULT: Self = Self::UNDER_WAY;
257}
258impl Default for AisNavStatus {
259 fn default() -> Self {
260 Self::DEFAULT
261 }
262}
263#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
264#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
265#[cfg_attr(feature = "serde", serde(tag = "type"))]
266#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
267#[repr(u32)]
268pub enum MavOdidClassEu {
269 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
270 MAV_ODID_CLASS_EU_UNDECLARED = 0,
271 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
272 MAV_ODID_CLASS_EU_CLASS_0 = 1,
273 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
274 MAV_ODID_CLASS_EU_CLASS_1 = 2,
275 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
276 MAV_ODID_CLASS_EU_CLASS_2 = 3,
277 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
278 MAV_ODID_CLASS_EU_CLASS_3 = 4,
279 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
280 MAV_ODID_CLASS_EU_CLASS_4 = 5,
281 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
282 MAV_ODID_CLASS_EU_CLASS_5 = 6,
283 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
284 MAV_ODID_CLASS_EU_CLASS_6 = 7,
285}
286impl MavOdidClassEu {
287 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
288}
289impl Default for MavOdidClassEu {
290 fn default() -> Self {
291 Self::DEFAULT
292 }
293}
294#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
295#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
296#[cfg_attr(feature = "serde", serde(tag = "type"))]
297#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
298#[repr(u32)]
299#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
300pub enum MavBatteryMode {
301 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
302 MAV_BATTERY_MODE_UNKNOWN = 0,
303 #[doc = "Battery is auto discharging (towards storage level)."]
304 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
305 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
306 MAV_BATTERY_MODE_HOT_SWAP = 2,
307}
308impl MavBatteryMode {
309 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
310}
311impl Default for MavBatteryMode {
312 fn default() -> Self {
313 Self::DEFAULT
314 }
315}
316#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
317#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
318#[cfg_attr(feature = "serde", serde(tag = "type"))]
319#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
320#[repr(u32)]
321#[doc = "Type of landing target"]
322pub enum LandingTargetType {
323 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
324 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
325 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
326 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
327 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
328 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
329 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
330 LANDING_TARGET_TYPE_VISION_OTHER = 3,
331}
332impl LandingTargetType {
333 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
334}
335impl Default for LandingTargetType {
336 fn default() -> Self {
337 Self::DEFAULT
338 }
339}
340#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
342#[cfg_attr(feature = "serde", serde(tag = "type"))]
343#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
344#[repr(u32)]
345#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
346pub enum MavType {
347 #[doc = "Generic micro air vehicle"]
348 MAV_TYPE_GENERIC = 0,
349 #[doc = "Fixed wing aircraft."]
350 MAV_TYPE_FIXED_WING = 1,
351 #[doc = "Quadrotor"]
352 MAV_TYPE_QUADROTOR = 2,
353 #[doc = "Coaxial helicopter"]
354 MAV_TYPE_COAXIAL = 3,
355 #[doc = "Normal helicopter with tail rotor."]
356 MAV_TYPE_HELICOPTER = 4,
357 #[doc = "Ground installation"]
358 MAV_TYPE_ANTENNA_TRACKER = 5,
359 #[doc = "Operator control unit / ground control station"]
360 MAV_TYPE_GCS = 6,
361 #[doc = "Airship, controlled"]
362 MAV_TYPE_AIRSHIP = 7,
363 #[doc = "Free balloon, uncontrolled"]
364 MAV_TYPE_FREE_BALLOON = 8,
365 #[doc = "Rocket"]
366 MAV_TYPE_ROCKET = 9,
367 #[doc = "Ground rover"]
368 MAV_TYPE_GROUND_ROVER = 10,
369 #[doc = "Surface vessel, boat, ship"]
370 MAV_TYPE_SURFACE_BOAT = 11,
371 #[doc = "Submarine"]
372 MAV_TYPE_SUBMARINE = 12,
373 #[doc = "Hexarotor"]
374 MAV_TYPE_HEXAROTOR = 13,
375 #[doc = "Octorotor"]
376 MAV_TYPE_OCTOROTOR = 14,
377 #[doc = "Tricopter"]
378 MAV_TYPE_TRICOPTER = 15,
379 #[doc = "Flapping wing"]
380 MAV_TYPE_FLAPPING_WING = 16,
381 #[doc = "Kite"]
382 MAV_TYPE_KITE = 17,
383 #[doc = "Onboard companion controller"]
384 MAV_TYPE_ONBOARD_CONTROLLER = 18,
385 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
386 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
387 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
388 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
389 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
390 MAV_TYPE_VTOL_TILTROTOR = 21,
391 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
392 MAV_TYPE_VTOL_FIXEDROTOR = 22,
393 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
394 MAV_TYPE_VTOL_TAILSITTER = 23,
395 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
396 MAV_TYPE_VTOL_TILTWING = 24,
397 #[doc = "VTOL reserved 5"]
398 MAV_TYPE_VTOL_RESERVED5 = 25,
399 #[doc = "Gimbal"]
400 MAV_TYPE_GIMBAL = 26,
401 #[doc = "ADSB system"]
402 MAV_TYPE_ADSB = 27,
403 #[doc = "Steerable, nonrigid airfoil"]
404 MAV_TYPE_PARAFOIL = 28,
405 #[doc = "Dodecarotor"]
406 MAV_TYPE_DODECAROTOR = 29,
407 #[doc = "Camera"]
408 MAV_TYPE_CAMERA = 30,
409 #[doc = "Charging station"]
410 MAV_TYPE_CHARGING_STATION = 31,
411 #[doc = "FLARM collision avoidance system"]
412 MAV_TYPE_FLARM = 32,
413 #[doc = "Servo"]
414 MAV_TYPE_SERVO = 33,
415 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
416 MAV_TYPE_ODID = 34,
417 #[doc = "Decarotor"]
418 MAV_TYPE_DECAROTOR = 35,
419 #[doc = "Battery"]
420 MAV_TYPE_BATTERY = 36,
421 #[doc = "Parachute"]
422 MAV_TYPE_PARACHUTE = 37,
423 #[doc = "Log"]
424 MAV_TYPE_LOG = 38,
425 #[doc = "OSD"]
426 MAV_TYPE_OSD = 39,
427 #[doc = "IMU"]
428 MAV_TYPE_IMU = 40,
429 #[doc = "GPS"]
430 MAV_TYPE_GPS = 41,
431 #[doc = "Winch"]
432 MAV_TYPE_WINCH = 42,
433 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
434 MAV_TYPE_GENERIC_MULTIROTOR = 43,
435 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
436 MAV_TYPE_ILLUMINATOR = 44,
437 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
438 MAV_TYPE_SPACECRAFT_ORBITER = 45,
439}
440impl MavType {
441 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
442}
443impl Default for MavType {
444 fn default() -> Self {
445 Self::DEFAULT
446 }
447}
448#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
449#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
450#[cfg_attr(feature = "serde", serde(tag = "type"))]
451#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
452#[repr(u32)]
453#[doc = "Possible safety switch states."]
454pub enum SafetySwitchState {
455 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
456 SAFETY_SWITCH_STATE_SAFE = 0,
457 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
458 SAFETY_SWITCH_STATE_DANGEROUS = 1,
459}
460impl SafetySwitchState {
461 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
462}
463impl Default for SafetySwitchState {
464 fn default() -> Self {
465 Self::DEFAULT
466 }
467}
468#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
469#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
470#[cfg_attr(feature = "serde", serde(tag = "type"))]
471#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
472#[repr(u32)]
473#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
474pub enum MavCmd {
475 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
476 MAV_CMD_NAV_WAYPOINT = 16,
477 #[doc = "Loiter around this waypoint an unlimited amount of time"]
478 MAV_CMD_NAV_LOITER_UNLIM = 17,
479 #[doc = "Loiter around this waypoint for X turns"]
480 MAV_CMD_NAV_LOITER_TURNS = 18,
481 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
482 MAV_CMD_NAV_LOITER_TIME = 19,
483 #[doc = "Return to launch location"]
484 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
485 #[doc = "Land at location."]
486 MAV_CMD_NAV_LAND = 21,
487 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
488 MAV_CMD_NAV_TAKEOFF = 22,
489 #[doc = "Land at local position (local frame only)"]
490 MAV_CMD_NAV_LAND_LOCAL = 23,
491 #[doc = "Takeoff from local position (local frame only)"]
492 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
493 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
494 MAV_CMD_NAV_FOLLOW = 25,
495 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
496 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
497 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
498 MAV_CMD_NAV_LOITER_TO_ALT = 31,
499 #[doc = "Begin following a target"]
500 MAV_CMD_DO_FOLLOW = 32,
501 #[doc = "Reposition the MAV after a follow target command has been sent"]
502 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
503 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
504 MAV_CMD_DO_ORBIT = 34,
505 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
506 MAV_CMD_NAV_ROI = 80,
507 #[doc = "Control autonomous path planning on the MAV."]
508 MAV_CMD_NAV_PATHPLANNING = 81,
509 #[doc = "Navigate to waypoint using a spline path."]
510 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
511 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
512 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
513 #[doc = "Land using VTOL mode"]
514 MAV_CMD_NAV_VTOL_LAND = 85,
515 #[doc = "hand control over to an external controller"]
516 MAV_CMD_NAV_GUIDED_ENABLE = 92,
517 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
518 MAV_CMD_NAV_DELAY = 93,
519 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
520 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
521 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
522 MAV_CMD_NAV_LAST = 95,
523 #[doc = "Delay mission state machine."]
524 MAV_CMD_CONDITION_DELAY = 112,
525 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
526 MAV_CMD_CONDITION_CHANGE_ALT = 113,
527 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
528 MAV_CMD_CONDITION_DISTANCE = 114,
529 #[doc = "Reach a certain target angle."]
530 MAV_CMD_CONDITION_YAW = 115,
531 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
532 MAV_CMD_CONDITION_LAST = 159,
533 #[doc = "Set system mode."]
534 MAV_CMD_DO_SET_MODE = 176,
535 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
536 MAV_CMD_DO_JUMP = 177,
537 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
538 MAV_CMD_DO_CHANGE_SPEED = 178,
539 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
540 MAV_CMD_DO_SET_HOME = 179,
541 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
542 MAV_CMD_DO_SET_PARAMETER = 180,
543 #[doc = "Set a relay to a condition."]
544 MAV_CMD_DO_SET_RELAY = 181,
545 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
546 MAV_CMD_DO_REPEAT_RELAY = 182,
547 #[doc = "Set a servo to a desired PWM value."]
548 MAV_CMD_DO_SET_SERVO = 183,
549 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
550 MAV_CMD_DO_REPEAT_SERVO = 184,
551 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
552 MAV_CMD_DO_FLIGHTTERMINATION = 185,
553 #[doc = "Change altitude set point."]
554 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
555 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
556 MAV_CMD_DO_SET_ACTUATOR = 187,
557 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
558 MAV_CMD_DO_RETURN_PATH_START = 188,
559 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
560 MAV_CMD_DO_LAND_START = 189,
561 #[doc = "Mission command to perform a landing from a rally point."]
562 MAV_CMD_DO_RALLY_LAND = 190,
563 #[doc = "Mission command to safely abort an autonomous landing."]
564 MAV_CMD_DO_GO_AROUND = 191,
565 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
566 MAV_CMD_DO_REPOSITION = 192,
567 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
568 MAV_CMD_DO_PAUSE_CONTINUE = 193,
569 #[doc = "Set moving direction to forward or reverse."]
570 MAV_CMD_DO_SET_REVERSE = 194,
571 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
572 MAV_CMD_DO_SET_ROI_LOCATION = 195,
573 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
574 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
575 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
576 MAV_CMD_DO_SET_ROI_NONE = 197,
577 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
578 MAV_CMD_DO_SET_ROI_SYSID = 198,
579 #[doc = "Control onboard camera system."]
580 MAV_CMD_DO_CONTROL_VIDEO = 200,
581 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
582 MAV_CMD_DO_SET_ROI = 201,
583 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
584 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
585 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
586 MAV_CMD_DO_DIGICAM_CONTROL = 203,
587 #[doc = "Mission command to configure a camera or antenna mount"]
588 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
589 #[doc = "Mission command to control a camera or antenna mount"]
590 MAV_CMD_DO_MOUNT_CONTROL = 205,
591 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
592 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
593 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
594 MAV_CMD_DO_FENCE_ENABLE = 207,
595 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
596 MAV_CMD_DO_PARACHUTE = 208,
597 #[doc = "Command to perform motor test."]
598 MAV_CMD_DO_MOTOR_TEST = 209,
599 #[doc = "Change to/from inverted flight."]
600 MAV_CMD_DO_INVERTED_FLIGHT = 210,
601 #[doc = "Mission command to operate a gripper."]
602 MAV_CMD_DO_GRIPPER = 211,
603 #[doc = "Enable/disable autotune."]
604 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
605 #[doc = "Sets a desired vehicle turn angle and speed change."]
606 MAV_CMD_NAV_SET_YAW_SPEED = 213,
607 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
608 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
609 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
610 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
611 #[doc = "set id of master controller"]
612 MAV_CMD_DO_GUIDED_MASTER = 221,
613 #[doc = "Set limits for external control"]
614 MAV_CMD_DO_GUIDED_LIMITS = 222,
615 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
616 MAV_CMD_DO_ENGINE_CONTROL = 223,
617 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
618 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
619 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
620 MAV_CMD_DO_LAST = 240,
621 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
622 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
623 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
624 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
625 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
626 MAV_CMD_PREFLIGHT_UAVCAN = 243,
627 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
628 MAV_CMD_PREFLIGHT_STORAGE = 245,
629 #[doc = "Request the reboot or shutdown of system components."]
630 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
631 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
632 MAV_CMD_OVERRIDE_GOTO = 252,
633 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
634 MAV_CMD_OBLIQUE_SURVEY = 260,
635 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
636 MAV_CMD_DO_SET_STANDARD_MODE = 262,
637 #[doc = "start running a mission"]
638 MAV_CMD_MISSION_START = 300,
639 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
640 MAV_CMD_ACTUATOR_TEST = 310,
641 #[doc = "Actuator configuration command."]
642 MAV_CMD_CONFIGURE_ACTUATOR = 311,
643 #[doc = "Arms / Disarms a component"]
644 MAV_CMD_COMPONENT_ARM_DISARM = 400,
645 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
646 MAV_CMD_RUN_PREARM_CHECKS = 401,
647 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
648 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
649 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
650 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
651 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
652 MAV_CMD_GET_HOME_POSITION = 410,
653 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
654 MAV_CMD_INJECT_FAILURE = 420,
655 #[doc = "Starts receiver pairing."]
656 MAV_CMD_START_RX_PAIR = 500,
657 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
658 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
659 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
660 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
661 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
662 MAV_CMD_REQUEST_MESSAGE = 512,
663 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
664 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
665 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
666 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
667 #[doc = "Request camera information (CAMERA_INFORMATION)."]
668 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
669 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
670 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
671 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
672 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
673 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
674 MAV_CMD_STORAGE_FORMAT = 526,
675 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
676 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
677 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
678 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
679 #[doc = "Reset all camera settings to Factory Default"]
680 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
681 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
682 MAV_CMD_SET_CAMERA_MODE = 530,
683 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
684 MAV_CMD_SET_CAMERA_ZOOM = 531,
685 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
686 MAV_CMD_SET_CAMERA_FOCUS = 532,
687 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
688 MAV_CMD_SET_STORAGE_USAGE = 533,
689 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
690 MAV_CMD_SET_CAMERA_SOURCE = 534,
691 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
692 MAV_CMD_JUMP_TAG = 600,
693 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
694 MAV_CMD_DO_JUMP_TAG = 601,
695 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
696 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
697 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
698 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
699 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
700 MAV_CMD_IMAGE_START_CAPTURE = 2000,
701 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
702 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
703 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
704 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
705 #[doc = "Enable or disable on-board camera triggering system."]
706 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
707 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
708 MAV_CMD_CAMERA_TRACK_POINT = 2004,
709 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
710 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
711 #[doc = "Stops ongoing tracking."]
712 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
713 #[doc = "Starts video capture (recording)."]
714 MAV_CMD_VIDEO_START_CAPTURE = 2500,
715 #[doc = "Stop the current video capture (recording)."]
716 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
717 #[doc = "Start video streaming"]
718 MAV_CMD_VIDEO_START_STREAMING = 2502,
719 #[doc = "Stop the given video stream"]
720 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
721 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
722 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
723 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
724 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
725 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
726 MAV_CMD_LOGGING_START = 2510,
727 #[doc = "Request to stop streaming log data over MAVLink"]
728 MAV_CMD_LOGGING_STOP = 2511,
729 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
730 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
731 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
732 #[doc = "Create a panorama at the current position"]
733 MAV_CMD_PANORAMA_CREATE = 2800,
734 #[doc = "Request VTOL transition"]
735 MAV_CMD_DO_VTOL_TRANSITION = 3000,
736 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
737 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
738 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
739 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
740 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
741 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
742 #[doc = "Delay mission state machine until gate has been reached."]
743 MAV_CMD_CONDITION_GATE = 4501,
744 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
745 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
746 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
747 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
748 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
749 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
750 #[doc = "Circular fence area. The vehicle must stay inside this area."]
751 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
752 #[doc = "Circular fence area. The vehicle must stay outside this area."]
753 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
754 #[doc = "Rally point. You can have multiple rally points defined."]
755 MAV_CMD_NAV_RALLY_POINT = 5100,
756 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
757 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
758 #[doc = "Change state of safety switch."]
759 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
760 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
761 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
762 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
763 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
764 #[doc = "Control the payload deployment."]
765 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
766 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
767 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
768 #[doc = "Command to operate winch."]
769 MAV_CMD_DO_WINCH = 42600,
770 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
771 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
772 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
773 MAV_CMD_WAYPOINT_USER_1 = 31000,
774 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
775 MAV_CMD_WAYPOINT_USER_2 = 31001,
776 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
777 MAV_CMD_WAYPOINT_USER_3 = 31002,
778 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
779 MAV_CMD_WAYPOINT_USER_4 = 31003,
780 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
781 MAV_CMD_WAYPOINT_USER_5 = 31004,
782 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
783 MAV_CMD_SPATIAL_USER_1 = 31005,
784 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
785 MAV_CMD_SPATIAL_USER_2 = 31006,
786 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
787 MAV_CMD_SPATIAL_USER_3 = 31007,
788 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
789 MAV_CMD_SPATIAL_USER_4 = 31008,
790 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
791 MAV_CMD_SPATIAL_USER_5 = 31009,
792 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
793 MAV_CMD_USER_1 = 31010,
794 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
795 MAV_CMD_USER_2 = 31011,
796 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
797 MAV_CMD_USER_3 = 31012,
798 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
799 MAV_CMD_USER_4 = 31013,
800 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
801 MAV_CMD_USER_5 = 31014,
802 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
803 MAV_CMD_CAN_FORWARD = 32000,
804 #[doc = "AVSS defined command. Set PRS arm statuses."]
805 MAV_CMD_PRS_SET_ARM = 60050,
806 #[doc = "AVSS defined command. Gets PRS arm statuses"]
807 MAV_CMD_PRS_GET_ARM = 60051,
808 #[doc = "AVSS defined command. Get the PRS battery voltage in millivolts"]
809 MAV_CMD_PRS_GET_BATTERY = 60052,
810 #[doc = "AVSS defined command. Get the PRS error statuses."]
811 MAV_CMD_PRS_GET_ERR = 60053,
812 #[doc = "AVSS defined command. Set the ATS arming altitude in meters."]
813 MAV_CMD_PRS_SET_ARM_ALTI = 60070,
814 #[doc = "AVSS defined command. Get the ATS arming altitude in meters."]
815 MAV_CMD_PRS_GET_ARM_ALTI = 60071,
816 #[doc = "AVSS defined command. Shuts down the PRS system."]
817 MAV_CMD_PRS_SHUTDOWN = 60072,
818}
819impl MavCmd {
820 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
821}
822impl Default for MavCmd {
823 fn default() -> Self {
824 Self::DEFAULT
825 }
826}
827#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
828#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
829#[cfg_attr(feature = "serde", serde(tag = "type"))]
830#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
831#[repr(u32)]
832#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
833pub enum PrecisionLandMode {
834 #[doc = "Normal (non-precision) landing."]
835 PRECISION_LAND_MODE_DISABLED = 0,
836 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
837 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
838 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
839 PRECISION_LAND_MODE_REQUIRED = 2,
840}
841impl PrecisionLandMode {
842 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
843}
844impl Default for PrecisionLandMode {
845 fn default() -> Self {
846 Self::DEFAULT
847 }
848}
849#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
850#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
851#[cfg_attr(feature = "serde", serde(tag = "type"))]
852#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
853#[repr(u32)]
854pub enum AvssM300OperationMode {
855 #[doc = "In manual control mode"]
856 MODE_M300_MANUAL_CTRL = 0,
857 #[doc = "In attitude mode"]
858 MODE_M300_ATTITUDE = 1,
859 #[doc = "In GPS mode"]
860 MODE_M300_P_GPS = 6,
861 #[doc = "In hotpoint mode"]
862 MODE_M300_HOTPOINT_MODE = 9,
863 #[doc = "In assisted takeoff mode"]
864 MODE_M300_ASSISTED_TAKEOFF = 10,
865 #[doc = "In auto takeoff mode"]
866 MODE_M300_AUTO_TAKEOFF = 11,
867 #[doc = "In auto landing mode"]
868 MODE_M300_AUTO_LANDING = 12,
869 #[doc = "In go home mode"]
870 MODE_M300_NAVI_GO_HOME = 15,
871 #[doc = "In sdk control mode"]
872 MODE_M300_NAVI_SDK_CTRL = 17,
873 #[doc = "In sport mode"]
874 MODE_M300_S_SPORT = 31,
875 #[doc = "In force auto landing mode"]
876 MODE_M300_FORCE_AUTO_LANDING = 33,
877 #[doc = "In tripod mode"]
878 MODE_M300_T_TRIPOD = 38,
879 #[doc = "In search mode"]
880 MODE_M300_SEARCH_MODE = 40,
881 #[doc = "In engine mode"]
882 MODE_M300_ENGINE_START = 41,
883}
884impl AvssM300OperationMode {
885 pub const DEFAULT: Self = Self::MODE_M300_MANUAL_CTRL;
886}
887impl Default for AvssM300OperationMode {
888 fn default() -> Self {
889 Self::DEFAULT
890 }
891}
892bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
893impl MavPowerStatus {
894 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
895}
896impl Default for MavPowerStatus {
897 fn default() -> Self {
898 Self::DEFAULT
899 }
900}
901#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
902#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
903#[cfg_attr(feature = "serde", serde(tag = "type"))]
904#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
905#[repr(u32)]
906#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
907pub enum CameraZoomType {
908 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
909 ZOOM_TYPE_STEP = 0,
910 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
911 ZOOM_TYPE_CONTINUOUS = 1,
912 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
913 ZOOM_TYPE_RANGE = 2,
914 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
915 ZOOM_TYPE_FOCAL_LENGTH = 3,
916 #[doc = "Zoom value as horizontal field of view in degrees."]
917 ZOOM_TYPE_HORIZONTAL_FOV = 4,
918}
919impl CameraZoomType {
920 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
921}
922impl Default for CameraZoomType {
923 fn default() -> Self {
924 Self::DEFAULT
925 }
926}
927bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
928impl GimbalDeviceFlags {
929 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
930}
931impl Default for GimbalDeviceFlags {
932 fn default() -> Self {
933 Self::DEFAULT
934 }
935}
936#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
937#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
938#[cfg_attr(feature = "serde", serde(tag = "type"))]
939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
940#[repr(u32)]
941#[doc = "Winch actions."]
942pub enum WinchActions {
943 #[doc = "Allow motor to freewheel."]
944 WINCH_RELAXED = 0,
945 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
946 WINCH_RELATIVE_LENGTH_CONTROL = 1,
947 #[doc = "Wind or unwind line at specified rate."]
948 WINCH_RATE_CONTROL = 2,
949 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
950 WINCH_LOCK = 3,
951 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
952 WINCH_DELIVER = 4,
953 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
954 WINCH_HOLD = 5,
955 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
956 WINCH_RETRACT = 6,
957 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
958 WINCH_LOAD_LINE = 7,
959 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
960 WINCH_ABANDON_LINE = 8,
961 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
962 WINCH_LOAD_PAYLOAD = 9,
963}
964impl WinchActions {
965 pub const DEFAULT: Self = Self::WINCH_RELAXED;
966}
967impl Default for WinchActions {
968 fn default() -> Self {
969 Self::DEFAULT
970 }
971}
972#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
973#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
974#[cfg_attr(feature = "serde", serde(tag = "type"))]
975#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
976#[repr(u32)]
977pub enum MavOdidTimeAcc {
978 #[doc = "The timestamp accuracy is unknown."]
979 MAV_ODID_TIME_ACC_UNKNOWN = 0,
980 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
981 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
982 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
983 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
984 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
985 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
986 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
987 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
988 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
989 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
990 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
991 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
992 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
993 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
994 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
995 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
996 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
997 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
998 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
999 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
1000 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
1001 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
1002 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
1003 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
1004 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
1005 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
1006 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
1007 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
1008 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
1009 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
1010}
1011impl MavOdidTimeAcc {
1012 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
1013}
1014impl Default for MavOdidTimeAcc {
1015 fn default() -> Self {
1016 Self::DEFAULT
1017 }
1018}
1019bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1020impl MavBatteryFault {
1021 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1022}
1023impl Default for MavBatteryFault {
1024 fn default() -> Self {
1025 Self::DEFAULT
1026 }
1027}
1028#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1029#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1030#[cfg_attr(feature = "serde", serde(tag = "type"))]
1031#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1032#[repr(u32)]
1033#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
1034pub enum ParachuteAction {
1035 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
1036 PARACHUTE_DISABLE = 0,
1037 #[doc = "Enable auto-release of parachute."]
1038 PARACHUTE_ENABLE = 1,
1039 #[doc = "Release parachute and kill motors."]
1040 PARACHUTE_RELEASE = 2,
1041}
1042impl ParachuteAction {
1043 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
1044}
1045impl Default for ParachuteAction {
1046 fn default() -> Self {
1047 Self::DEFAULT
1048 }
1049}
1050#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1052#[cfg_attr(feature = "serde", serde(tag = "type"))]
1053#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1054#[repr(u32)]
1055#[doc = "Gripper actions."]
1056pub enum GripperActions {
1057 #[doc = "Gripper release cargo."]
1058 GRIPPER_ACTION_RELEASE = 0,
1059 #[doc = "Gripper grab onto cargo."]
1060 GRIPPER_ACTION_GRAB = 1,
1061}
1062impl GripperActions {
1063 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1064}
1065impl Default for GripperActions {
1066 fn default() -> Self {
1067 Self::DEFAULT
1068 }
1069}
1070#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1071#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1072#[cfg_attr(feature = "serde", serde(tag = "type"))]
1073#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1074#[repr(u32)]
1075pub enum MavOdidHeightRef {
1076 #[doc = "The height field is relative to the take-off location."]
1077 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
1078 #[doc = "The height field is relative to ground."]
1079 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
1080}
1081impl MavOdidHeightRef {
1082 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
1083}
1084impl Default for MavOdidHeightRef {
1085 fn default() -> Self {
1086 Self::DEFAULT
1087 }
1088}
1089#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1090#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1091#[cfg_attr(feature = "serde", serde(tag = "type"))]
1092#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1093#[repr(u32)]
1094#[doc = "Enumeration of battery functions"]
1095pub enum MavBatteryFunction {
1096 #[doc = "Battery function is unknown"]
1097 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1098 #[doc = "Battery supports all flight systems"]
1099 MAV_BATTERY_FUNCTION_ALL = 1,
1100 #[doc = "Battery for the propulsion system"]
1101 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1102 #[doc = "Avionics battery"]
1103 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1104 #[doc = "Payload battery"]
1105 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1106}
1107impl MavBatteryFunction {
1108 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1109}
1110impl Default for MavBatteryFunction {
1111 fn default() -> Self {
1112 Self::DEFAULT
1113 }
1114}
1115#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1116#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1117#[cfg_attr(feature = "serde", serde(tag = "type"))]
1118#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1119#[repr(u32)]
1120#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
1121pub enum RtkBaselineCoordinateSystem {
1122 #[doc = "Earth-centered, Earth-fixed"]
1123 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
1124 #[doc = "RTK basestation centered, north, east, down"]
1125 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
1126}
1127impl RtkBaselineCoordinateSystem {
1128 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
1129}
1130impl Default for RtkBaselineCoordinateSystem {
1131 fn default() -> Self {
1132 Self::DEFAULT
1133 }
1134}
1135bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
1136impl GimbalManagerCapFlags {
1137 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
1138}
1139impl Default for GimbalManagerCapFlags {
1140 fn default() -> Self {
1141 Self::DEFAULT
1142 }
1143}
1144#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1145#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1146#[cfg_attr(feature = "serde", serde(tag = "type"))]
1147#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1148#[repr(u32)]
1149pub enum MavOdidClassificationType {
1150 #[doc = "The classification type for the UA is undeclared."]
1151 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
1152 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
1153 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
1154}
1155impl MavOdidClassificationType {
1156 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
1157}
1158impl Default for MavOdidClassificationType {
1159 fn default() -> Self {
1160 Self::DEFAULT
1161 }
1162}
1163#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1164#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1165#[cfg_attr(feature = "serde", serde(tag = "type"))]
1166#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1167#[repr(u32)]
1168pub enum MavOdidOperatorIdType {
1169 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
1170 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
1171}
1172impl MavOdidOperatorIdType {
1173 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
1174}
1175impl Default for MavOdidOperatorIdType {
1176 fn default() -> Self {
1177 Self::DEFAULT
1178 }
1179}
1180#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1181#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1182#[cfg_attr(feature = "serde", serde(tag = "type"))]
1183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1184#[repr(u32)]
1185#[doc = "Yaw behaviour during orbit flight."]
1186pub enum OrbitYawBehaviour {
1187 #[doc = "Vehicle front points to the center (default)."]
1188 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
1189 #[doc = "Vehicle front holds heading when message received."]
1190 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
1191 #[doc = "Yaw uncontrolled."]
1192 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
1193 #[doc = "Vehicle front follows flight path (tangential to circle)."]
1194 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
1195 #[doc = "Yaw controlled by RC input."]
1196 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
1197 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
1198 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
1199}
1200impl OrbitYawBehaviour {
1201 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
1202}
1203impl Default for OrbitYawBehaviour {
1204 fn default() -> Self {
1205 Self::DEFAULT
1206 }
1207}
1208#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1209#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1210#[cfg_attr(feature = "serde", serde(tag = "type"))]
1211#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1212#[repr(u32)]
1213pub enum MagCalStatus {
1214 MAG_CAL_NOT_STARTED = 0,
1215 MAG_CAL_WAITING_TO_START = 1,
1216 MAG_CAL_RUNNING_STEP_ONE = 2,
1217 MAG_CAL_RUNNING_STEP_TWO = 3,
1218 MAG_CAL_SUCCESS = 4,
1219 MAG_CAL_FAILED = 5,
1220 MAG_CAL_BAD_ORIENTATION = 6,
1221 MAG_CAL_BAD_RADIUS = 7,
1222}
1223impl MagCalStatus {
1224 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1225}
1226impl Default for MagCalStatus {
1227 fn default() -> Self {
1228 Self::DEFAULT
1229 }
1230}
1231#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1232#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1233#[cfg_attr(feature = "serde", serde(tag = "type"))]
1234#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1235#[repr(u32)]
1236#[doc = "Generalized UAVCAN node mode"]
1237pub enum UavcanNodeMode {
1238 #[doc = "The node is performing its primary functions."]
1239 UAVCAN_NODE_MODE_OPERATIONAL = 0,
1240 #[doc = "The node is initializing; this mode is entered immediately after startup."]
1241 UAVCAN_NODE_MODE_INITIALIZATION = 1,
1242 #[doc = "The node is under maintenance."]
1243 UAVCAN_NODE_MODE_MAINTENANCE = 2,
1244 #[doc = "The node is in the process of updating its software."]
1245 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
1246 #[doc = "The node is no longer available online."]
1247 UAVCAN_NODE_MODE_OFFLINE = 7,
1248}
1249impl UavcanNodeMode {
1250 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
1251}
1252impl Default for UavcanNodeMode {
1253 fn default() -> Self {
1254 Self::DEFAULT
1255 }
1256}
1257#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1258#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1259#[cfg_attr(feature = "serde", serde(tag = "type"))]
1260#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1261#[repr(u32)]
1262#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
1263pub enum MavFrame {
1264 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
1265 MAV_FRAME_GLOBAL = 0,
1266 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
1267 MAV_FRAME_LOCAL_NED = 1,
1268 #[doc = "NOT a coordinate frame, indicates a mission command."]
1269 MAV_FRAME_MISSION = 2,
1270 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
1271 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
1272 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
1273 MAV_FRAME_LOCAL_ENU = 4,
1274 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
1275 MAV_FRAME_GLOBAL_INT = 5,
1276 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
1277 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
1278 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
1279 MAV_FRAME_LOCAL_OFFSET_NED = 7,
1280 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
1281 MAV_FRAME_BODY_NED = 8,
1282 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
1283 MAV_FRAME_BODY_OFFSET_NED = 9,
1284 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
1285 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
1286 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
1287 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
1288 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
1289 MAV_FRAME_BODY_FRD = 12,
1290 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
1291 MAV_FRAME_RESERVED_13 = 13,
1292 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
1293 MAV_FRAME_RESERVED_14 = 14,
1294 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
1295 MAV_FRAME_RESERVED_15 = 15,
1296 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
1297 MAV_FRAME_RESERVED_16 = 16,
1298 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
1299 MAV_FRAME_RESERVED_17 = 17,
1300 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
1301 MAV_FRAME_RESERVED_18 = 18,
1302 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
1303 MAV_FRAME_RESERVED_19 = 19,
1304 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
1305 MAV_FRAME_LOCAL_FRD = 20,
1306 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
1307 MAV_FRAME_LOCAL_FLU = 21,
1308}
1309impl MavFrame {
1310 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
1311}
1312impl Default for MavFrame {
1313 fn default() -> Self {
1314 Self::DEFAULT
1315 }
1316}
1317bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
1318impl VideoStreamStatusFlags {
1319 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
1320}
1321impl Default for VideoStreamStatusFlags {
1322 fn default() -> Self {
1323 Self::DEFAULT
1324 }
1325}
1326#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1327#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1328#[cfg_attr(feature = "serde", serde(tag = "type"))]
1329#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1330#[repr(u32)]
1331#[doc = "WiFi Mode."]
1332pub enum WifiConfigApMode {
1333 #[doc = "WiFi mode is undefined."]
1334 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
1335 #[doc = "WiFi configured as an access point."]
1336 WIFI_CONFIG_AP_MODE_AP = 1,
1337 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
1338 WIFI_CONFIG_AP_MODE_STATION = 2,
1339 #[doc = "WiFi disabled."]
1340 WIFI_CONFIG_AP_MODE_DISABLED = 3,
1341}
1342impl WifiConfigApMode {
1343 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
1344}
1345impl Default for WifiConfigApMode {
1346 fn default() -> Self {
1347 Self::DEFAULT
1348 }
1349}
1350#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1351#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1352#[cfg_attr(feature = "serde", serde(tag = "type"))]
1353#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1354#[repr(u32)]
1355#[doc = "Specifies the datatype of a MAVLink parameter."]
1356pub enum MavParamType {
1357 #[doc = "8-bit unsigned integer"]
1358 MAV_PARAM_TYPE_UINT8 = 1,
1359 #[doc = "8-bit signed integer"]
1360 MAV_PARAM_TYPE_INT8 = 2,
1361 #[doc = "16-bit unsigned integer"]
1362 MAV_PARAM_TYPE_UINT16 = 3,
1363 #[doc = "16-bit signed integer"]
1364 MAV_PARAM_TYPE_INT16 = 4,
1365 #[doc = "32-bit unsigned integer"]
1366 MAV_PARAM_TYPE_UINT32 = 5,
1367 #[doc = "32-bit signed integer"]
1368 MAV_PARAM_TYPE_INT32 = 6,
1369 #[doc = "64-bit unsigned integer"]
1370 MAV_PARAM_TYPE_UINT64 = 7,
1371 #[doc = "64-bit signed integer"]
1372 MAV_PARAM_TYPE_INT64 = 8,
1373 #[doc = "32-bit floating-point"]
1374 MAV_PARAM_TYPE_REAL32 = 9,
1375 #[doc = "64-bit floating-point"]
1376 MAV_PARAM_TYPE_REAL64 = 10,
1377}
1378impl MavParamType {
1379 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
1380}
1381impl Default for MavParamType {
1382 fn default() -> Self {
1383 Self::DEFAULT
1384 }
1385}
1386#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1387#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1388#[cfg_attr(feature = "serde", serde(tag = "type"))]
1389#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1390#[repr(u32)]
1391#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
1392pub enum WifiConfigApResponse {
1393 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
1394 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
1395 #[doc = "Changes accepted."]
1396 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
1397 #[doc = "Changes rejected."]
1398 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
1399 #[doc = "Invalid Mode."]
1400 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
1401 #[doc = "Invalid SSID."]
1402 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
1403 #[doc = "Invalid Password."]
1404 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
1405}
1406impl WifiConfigApResponse {
1407 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
1408}
1409impl Default for WifiConfigApResponse {
1410 fn default() -> Self {
1411 Self::DEFAULT
1412 }
1413}
1414#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1415#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1416#[cfg_attr(feature = "serde", serde(tag = "type"))]
1417#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1418#[repr(u32)]
1419#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
1420pub enum FenceType {
1421 #[doc = "Maximum altitude fence"]
1422 FENCE_TYPE_ALT_MAX = 1,
1423 #[doc = "Circle fence"]
1424 FENCE_TYPE_CIRCLE = 2,
1425 #[doc = "Polygon fence"]
1426 FENCE_TYPE_POLYGON = 4,
1427 #[doc = "Minimum altitude fence"]
1428 FENCE_TYPE_ALT_MIN = 8,
1429}
1430impl FenceType {
1431 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
1432}
1433impl Default for FenceType {
1434 fn default() -> Self {
1435 Self::DEFAULT
1436 }
1437}
1438#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1439#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1440#[cfg_attr(feature = "serde", serde(tag = "type"))]
1441#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1442#[repr(u32)]
1443#[doc = "Airborne status of UAS."]
1444pub enum UtmFlightState {
1445 #[doc = "The flight state can't be determined."]
1446 UTM_FLIGHT_STATE_UNKNOWN = 1,
1447 #[doc = "UAS on ground."]
1448 UTM_FLIGHT_STATE_GROUND = 2,
1449 #[doc = "UAS airborne."]
1450 UTM_FLIGHT_STATE_AIRBORNE = 3,
1451 #[doc = "UAS is in an emergency flight state."]
1452 UTM_FLIGHT_STATE_EMERGENCY = 16,
1453 #[doc = "UAS has no active controls."]
1454 UTM_FLIGHT_STATE_NOCTRL = 32,
1455}
1456impl UtmFlightState {
1457 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
1458}
1459impl Default for UtmFlightState {
1460 fn default() -> Self {
1461 Self::DEFAULT
1462 }
1463}
1464#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1465#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1466#[cfg_attr(feature = "serde", serde(tag = "type"))]
1467#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1468#[repr(u32)]
1469pub enum MavAvssCommandFailureReason {
1470 #[doc = "AVSS defined command failure reason. PRS not steady."]
1471 PRS_NOT_STEADY = 1,
1472 #[doc = "AVSS defined command failure reason. PRS DTM not armed."]
1473 PRS_DTM_NOT_ARMED = 2,
1474 #[doc = "AVSS defined command failure reason. PRS OTM not armed."]
1475 PRS_OTM_NOT_ARMED = 3,
1476}
1477impl MavAvssCommandFailureReason {
1478 pub const DEFAULT: Self = Self::PRS_NOT_STEADY;
1479}
1480impl Default for MavAvssCommandFailureReason {
1481 fn default() -> Self {
1482 Self::DEFAULT
1483 }
1484}
1485#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1486#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1487#[cfg_attr(feature = "serde", serde(tag = "type"))]
1488#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1489#[repr(u32)]
1490pub enum MavOdidSpeedAcc {
1491 #[doc = "The speed accuracy is unknown."]
1492 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
1493 #[doc = "The speed accuracy is smaller than 10 meters per second."]
1494 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
1495 #[doc = "The speed accuracy is smaller than 3 meters per second."]
1496 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
1497 #[doc = "The speed accuracy is smaller than 1 meters per second."]
1498 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
1499 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
1500 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
1501}
1502impl MavOdidSpeedAcc {
1503 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
1504}
1505impl Default for MavOdidSpeedAcc {
1506 fn default() -> Self {
1507 Self::DEFAULT
1508 }
1509}
1510#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1511#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1512#[cfg_attr(feature = "serde", serde(tag = "type"))]
1513#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1514#[repr(u32)]
1515#[doc = "Aircraft-rated danger from this threat."]
1516pub enum MavCollisionThreatLevel {
1517 #[doc = "Not a threat"]
1518 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1519 #[doc = "Craft is mildly concerned about this threat"]
1520 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1521 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1522 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1523}
1524impl MavCollisionThreatLevel {
1525 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1526}
1527impl Default for MavCollisionThreatLevel {
1528 fn default() -> Self {
1529 Self::DEFAULT
1530 }
1531}
1532#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1533#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1534#[cfg_attr(feature = "serde", serde(tag = "type"))]
1535#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1536#[repr(u32)]
1537#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
1538pub enum AdsbEmitterType {
1539 ADSB_EMITTER_TYPE_NO_INFO = 0,
1540 ADSB_EMITTER_TYPE_LIGHT = 1,
1541 ADSB_EMITTER_TYPE_SMALL = 2,
1542 ADSB_EMITTER_TYPE_LARGE = 3,
1543 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
1544 ADSB_EMITTER_TYPE_HEAVY = 5,
1545 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
1546 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
1547 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
1548 ADSB_EMITTER_TYPE_GLIDER = 9,
1549 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
1550 ADSB_EMITTER_TYPE_PARACHUTE = 11,
1551 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
1552 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
1553 ADSB_EMITTER_TYPE_UAV = 14,
1554 ADSB_EMITTER_TYPE_SPACE = 15,
1555 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
1556 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
1557 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
1558 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
1559}
1560impl AdsbEmitterType {
1561 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
1562}
1563impl Default for AdsbEmitterType {
1564 fn default() -> Self {
1565 Self::DEFAULT
1566 }
1567}
1568#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1569#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1570#[cfg_attr(feature = "serde", serde(tag = "type"))]
1571#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1572#[repr(u32)]
1573#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
1574pub enum MavDoRepositionFlags {
1575 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
1576 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
1577}
1578impl MavDoRepositionFlags {
1579 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
1580}
1581impl Default for MavDoRepositionFlags {
1582 fn default() -> Self {
1583 Self::DEFAULT
1584 }
1585}
1586bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
1587impl GimbalManagerFlags {
1588 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
1589}
1590impl Default for GimbalManagerFlags {
1591 fn default() -> Self {
1592 Self::DEFAULT
1593 }
1594}
1595#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1597#[cfg_attr(feature = "serde", serde(tag = "type"))]
1598#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1599#[repr(u32)]
1600#[doc = "Flags to indicate the type of storage."]
1601pub enum StorageType {
1602 #[doc = "Storage type is not known."]
1603 STORAGE_TYPE_UNKNOWN = 0,
1604 #[doc = "Storage type is USB device."]
1605 STORAGE_TYPE_USB_STICK = 1,
1606 #[doc = "Storage type is SD card."]
1607 STORAGE_TYPE_SD = 2,
1608 #[doc = "Storage type is microSD card."]
1609 STORAGE_TYPE_MICROSD = 3,
1610 #[doc = "Storage type is CFast."]
1611 STORAGE_TYPE_CF = 4,
1612 #[doc = "Storage type is CFexpress."]
1613 STORAGE_TYPE_CFE = 5,
1614 #[doc = "Storage type is XQD."]
1615 STORAGE_TYPE_XQD = 6,
1616 #[doc = "Storage type is HD mass storage type."]
1617 STORAGE_TYPE_HD = 7,
1618 #[doc = "Storage type is other, not listed type."]
1619 STORAGE_TYPE_OTHER = 254,
1620}
1621impl StorageType {
1622 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
1623}
1624impl Default for StorageType {
1625 fn default() -> Self {
1626 Self::DEFAULT
1627 }
1628}
1629#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1630#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1631#[cfg_attr(feature = "serde", serde(tag = "type"))]
1632#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1633#[repr(u32)]
1634pub enum FenceBreach {
1635 #[doc = "No last fence breach"]
1636 FENCE_BREACH_NONE = 0,
1637 #[doc = "Breached minimum altitude"]
1638 FENCE_BREACH_MINALT = 1,
1639 #[doc = "Breached maximum altitude"]
1640 FENCE_BREACH_MAXALT = 2,
1641 #[doc = "Breached fence boundary"]
1642 FENCE_BREACH_BOUNDARY = 3,
1643}
1644impl FenceBreach {
1645 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
1646}
1647impl Default for FenceBreach {
1648 fn default() -> Self {
1649 Self::DEFAULT
1650 }
1651}
1652#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1653#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1654#[cfg_attr(feature = "serde", serde(tag = "type"))]
1655#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1656#[repr(u32)]
1657#[doc = "Reason for an event error response."]
1658pub enum MavEventErrorReason {
1659 #[doc = "The requested event is not available (anymore)."]
1660 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
1661}
1662impl MavEventErrorReason {
1663 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
1664}
1665impl Default for MavEventErrorReason {
1666 fn default() -> Self {
1667 Self::DEFAULT
1668 }
1669}
1670#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1671#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1672#[cfg_attr(feature = "serde", serde(tag = "type"))]
1673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1674#[repr(u32)]
1675#[doc = "Video stream types"]
1676pub enum VideoStreamType {
1677 #[doc = "Stream is RTSP"]
1678 VIDEO_STREAM_TYPE_RTSP = 0,
1679 #[doc = "Stream is RTP UDP (URI gives the port number)"]
1680 VIDEO_STREAM_TYPE_RTPUDP = 1,
1681 #[doc = "Stream is MPEG on TCP"]
1682 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
1683 #[doc = "Stream is MPEG TS (URI gives the port number)"]
1684 VIDEO_STREAM_TYPE_MPEG_TS = 3,
1685}
1686impl VideoStreamType {
1687 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
1688}
1689impl Default for VideoStreamType {
1690 fn default() -> Self {
1691 Self::DEFAULT
1692 }
1693}
1694#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1695#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1696#[cfg_attr(feature = "serde", serde(tag = "type"))]
1697#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1698#[repr(u32)]
1699#[doc = "Camera tracking status flags"]
1700pub enum CameraTrackingStatusFlags {
1701 #[doc = "Camera is not tracking"]
1702 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
1703 #[doc = "Camera is tracking"]
1704 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
1705 #[doc = "Camera tracking in error state"]
1706 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
1707}
1708impl CameraTrackingStatusFlags {
1709 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
1710}
1711impl Default for CameraTrackingStatusFlags {
1712 fn default() -> Self {
1713 Self::DEFAULT
1714 }
1715}
1716#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1717#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1718#[cfg_attr(feature = "serde", serde(tag = "type"))]
1719#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1720#[repr(u32)]
1721pub enum MavOdidOperatorLocationType {
1722 #[doc = "The location/altitude of the operator is the same as the take-off location."]
1723 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
1724 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
1725 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
1726 #[doc = "The location/altitude of the operator are fixed values."]
1727 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
1728}
1729impl MavOdidOperatorLocationType {
1730 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
1731}
1732impl Default for MavOdidOperatorLocationType {
1733 fn default() -> Self {
1734 Self::DEFAULT
1735 }
1736}
1737#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1738#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1739#[cfg_attr(feature = "serde", serde(tag = "type"))]
1740#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1741#[repr(u32)]
1742#[doc = "Result from a MAVLink command (MAV_CMD)"]
1743pub enum MavResult {
1744 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
1745 MAV_RESULT_ACCEPTED = 0,
1746 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
1747 MAV_RESULT_TEMPORARILY_REJECTED = 1,
1748 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
1749 MAV_RESULT_DENIED = 2,
1750 #[doc = "Command is not supported (unknown)."]
1751 MAV_RESULT_UNSUPPORTED = 3,
1752 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
1753 MAV_RESULT_FAILED = 4,
1754 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
1755 MAV_RESULT_IN_PROGRESS = 5,
1756 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
1757 MAV_RESULT_CANCELLED = 6,
1758 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
1759 MAV_RESULT_COMMAND_LONG_ONLY = 7,
1760 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
1761 MAV_RESULT_COMMAND_INT_ONLY = 8,
1762 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
1763 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
1764}
1765impl MavResult {
1766 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
1767}
1768impl Default for MavResult {
1769 fn default() -> Self {
1770 Self::DEFAULT
1771 }
1772}
1773#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1774#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1775#[cfg_attr(feature = "serde", serde(tag = "type"))]
1776#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1777#[repr(u32)]
1778pub enum MavOdidIdType {
1779 #[doc = "No type defined."]
1780 MAV_ODID_ID_TYPE_NONE = 0,
1781 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
1782 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
1783 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
1784 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
1785 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
1786 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
1787 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
1788 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
1789}
1790impl MavOdidIdType {
1791 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
1792}
1793impl Default for MavOdidIdType {
1794 fn default() -> Self {
1795 Self::DEFAULT
1796 }
1797}
1798#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1799#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1800#[cfg_attr(feature = "serde", serde(tag = "type"))]
1801#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1802#[repr(u32)]
1803#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
1804pub enum MotorTestThrottleType {
1805 #[doc = "Throttle as a percentage (0 ~ 100)"]
1806 MOTOR_TEST_THROTTLE_PERCENT = 0,
1807 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
1808 MOTOR_TEST_THROTTLE_PWM = 1,
1809 #[doc = "Throttle pass-through from pilot's transmitter."]
1810 MOTOR_TEST_THROTTLE_PILOT = 2,
1811 #[doc = "Per-motor compass calibration test."]
1812 MOTOR_TEST_COMPASS_CAL = 3,
1813}
1814impl MotorTestThrottleType {
1815 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
1816}
1817impl Default for MotorTestThrottleType {
1818 fn default() -> Self {
1819 Self::DEFAULT
1820 }
1821}
1822#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1823#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1824#[cfg_attr(feature = "serde", serde(tag = "type"))]
1825#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1826#[repr(u32)]
1827#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
1828pub enum CompMetadataType {
1829 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
1830 COMP_METADATA_TYPE_GENERAL = 0,
1831 #[doc = "Parameter meta data."]
1832 COMP_METADATA_TYPE_PARAMETER = 1,
1833 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
1834 COMP_METADATA_TYPE_COMMANDS = 2,
1835 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
1836 COMP_METADATA_TYPE_PERIPHERALS = 3,
1837 #[doc = "Meta data for the events interface."]
1838 COMP_METADATA_TYPE_EVENTS = 4,
1839 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
1840 COMP_METADATA_TYPE_ACTUATORS = 5,
1841}
1842impl CompMetadataType {
1843 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
1844}
1845impl Default for CompMetadataType {
1846 fn default() -> Self {
1847 Self::DEFAULT
1848 }
1849}
1850#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1851#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1852#[cfg_attr(feature = "serde", serde(tag = "type"))]
1853#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1854#[repr(u32)]
1855#[doc = "Result from PARAM_EXT_SET message."]
1856pub enum ParamAck {
1857 #[doc = "Parameter value ACCEPTED and SET"]
1858 PARAM_ACK_ACCEPTED = 0,
1859 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
1860 PARAM_ACK_VALUE_UNSUPPORTED = 1,
1861 #[doc = "Parameter failed to set"]
1862 PARAM_ACK_FAILED = 2,
1863 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
1864 PARAM_ACK_IN_PROGRESS = 3,
1865}
1866impl ParamAck {
1867 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
1868}
1869impl Default for ParamAck {
1870 fn default() -> Self {
1871 Self::DEFAULT
1872 }
1873}
1874#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1875#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1876#[cfg_attr(feature = "serde", serde(tag = "type"))]
1877#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1878#[repr(u32)]
1879pub enum CanFilterOp {
1880 CAN_FILTER_REPLACE = 0,
1881 CAN_FILTER_ADD = 1,
1882 CAN_FILTER_REMOVE = 2,
1883}
1884impl CanFilterOp {
1885 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
1886}
1887impl Default for CanFilterOp {
1888 fn default() -> Self {
1889 Self::DEFAULT
1890 }
1891}
1892#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1894#[cfg_attr(feature = "serde", serde(tag = "type"))]
1895#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1896#[repr(u32)]
1897pub enum MavOdidHorAcc {
1898 #[doc = "The horizontal accuracy is unknown."]
1899 MAV_ODID_HOR_ACC_UNKNOWN = 0,
1900 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
1901 MAV_ODID_HOR_ACC_10NM = 1,
1902 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
1903 MAV_ODID_HOR_ACC_4NM = 2,
1904 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
1905 MAV_ODID_HOR_ACC_2NM = 3,
1906 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
1907 MAV_ODID_HOR_ACC_1NM = 4,
1908 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
1909 MAV_ODID_HOR_ACC_0_5NM = 5,
1910 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
1911 MAV_ODID_HOR_ACC_0_3NM = 6,
1912 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
1913 MAV_ODID_HOR_ACC_0_1NM = 7,
1914 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
1915 MAV_ODID_HOR_ACC_0_05NM = 8,
1916 #[doc = "The horizontal accuracy is smaller than 30 meter."]
1917 MAV_ODID_HOR_ACC_30_METER = 9,
1918 #[doc = "The horizontal accuracy is smaller than 10 meter."]
1919 MAV_ODID_HOR_ACC_10_METER = 10,
1920 #[doc = "The horizontal accuracy is smaller than 3 meter."]
1921 MAV_ODID_HOR_ACC_3_METER = 11,
1922 #[doc = "The horizontal accuracy is smaller than 1 meter."]
1923 MAV_ODID_HOR_ACC_1_METER = 12,
1924}
1925impl MavOdidHorAcc {
1926 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
1927}
1928impl Default for MavOdidHorAcc {
1929 fn default() -> Self {
1930 Self::DEFAULT
1931 }
1932}
1933bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1934impl HighresImuUpdatedFlags {
1935 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1936}
1937impl Default for HighresImuUpdatedFlags {
1938 fn default() -> Self {
1939 Self::DEFAULT
1940 }
1941}
1942#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1943#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1944#[cfg_attr(feature = "serde", serde(tag = "type"))]
1945#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1946#[repr(u32)]
1947#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
1948pub enum MavFtpErr {
1949 #[doc = "None: No error"]
1950 MAV_FTP_ERR_NONE = 0,
1951 #[doc = "Fail: Unknown failure"]
1952 MAV_FTP_ERR_FAIL = 1,
1953 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
1954 MAV_FTP_ERR_FAILERRNO = 2,
1955 #[doc = "InvalidDataSize: Payload size is invalid"]
1956 MAV_FTP_ERR_INVALIDDATASIZE = 3,
1957 #[doc = "InvalidSession: Session is not currently open"]
1958 MAV_FTP_ERR_INVALIDSESSION = 4,
1959 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
1960 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
1961 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
1962 MAV_FTP_ERR_EOF = 6,
1963 #[doc = "UnknownCommand: Unknown command / opcode"]
1964 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
1965 #[doc = "FileExists: File/directory already exists"]
1966 MAV_FTP_ERR_FILEEXISTS = 8,
1967 #[doc = "FileProtected: File/directory is write protected"]
1968 MAV_FTP_ERR_FILEPROTECTED = 9,
1969 #[doc = "FileNotFound: File/directory not found"]
1970 MAV_FTP_ERR_FILENOTFOUND = 10,
1971}
1972impl MavFtpErr {
1973 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
1974}
1975impl Default for MavFtpErr {
1976 fn default() -> Self {
1977 Self::DEFAULT
1978 }
1979}
1980#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1981#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1982#[cfg_attr(feature = "serde", serde(tag = "type"))]
1983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1984#[repr(u32)]
1985pub enum MavOdidUaType {
1986 #[doc = "No UA (Unmanned Aircraft) type defined."]
1987 MAV_ODID_UA_TYPE_NONE = 0,
1988 #[doc = "Aeroplane/Airplane. Fixed wing."]
1989 MAV_ODID_UA_TYPE_AEROPLANE = 1,
1990 #[doc = "Helicopter or multirotor."]
1991 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
1992 #[doc = "Gyroplane."]
1993 MAV_ODID_UA_TYPE_GYROPLANE = 3,
1994 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
1995 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
1996 #[doc = "Ornithopter."]
1997 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
1998 #[doc = "Glider."]
1999 MAV_ODID_UA_TYPE_GLIDER = 6,
2000 #[doc = "Kite."]
2001 MAV_ODID_UA_TYPE_KITE = 7,
2002 #[doc = "Free Balloon."]
2003 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
2004 #[doc = "Captive Balloon."]
2005 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
2006 #[doc = "Airship. E.g. a blimp."]
2007 MAV_ODID_UA_TYPE_AIRSHIP = 10,
2008 #[doc = "Free Fall/Parachute (unpowered)."]
2009 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
2010 #[doc = "Rocket."]
2011 MAV_ODID_UA_TYPE_ROCKET = 12,
2012 #[doc = "Tethered powered aircraft."]
2013 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
2014 #[doc = "Ground Obstacle."]
2015 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
2016 #[doc = "Other type of aircraft not listed earlier."]
2017 MAV_ODID_UA_TYPE_OTHER = 15,
2018}
2019impl MavOdidUaType {
2020 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
2021}
2022impl Default for MavOdidUaType {
2023 fn default() -> Self {
2024 Self::DEFAULT
2025 }
2026}
2027#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2028#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2029#[cfg_attr(feature = "serde", serde(tag = "type"))]
2030#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2031#[repr(u32)]
2032#[doc = "List of possible units where failures can be injected."]
2033pub enum FailureUnit {
2034 FAILURE_UNIT_SENSOR_GYRO = 0,
2035 FAILURE_UNIT_SENSOR_ACCEL = 1,
2036 FAILURE_UNIT_SENSOR_MAG = 2,
2037 FAILURE_UNIT_SENSOR_BARO = 3,
2038 FAILURE_UNIT_SENSOR_GPS = 4,
2039 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
2040 FAILURE_UNIT_SENSOR_VIO = 6,
2041 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
2042 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
2043 FAILURE_UNIT_SYSTEM_BATTERY = 100,
2044 FAILURE_UNIT_SYSTEM_MOTOR = 101,
2045 FAILURE_UNIT_SYSTEM_SERVO = 102,
2046 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
2047 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
2048 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
2049}
2050impl FailureUnit {
2051 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
2052}
2053impl Default for FailureUnit {
2054 fn default() -> Self {
2055 Self::DEFAULT
2056 }
2057}
2058#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2060#[cfg_attr(feature = "serde", serde(tag = "type"))]
2061#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2062#[repr(u32)]
2063pub enum AvssHorseflyOperationMode {
2064 #[doc = "In manual control mode"]
2065 MODE_HORSEFLY_MANUAL_CTRL = 0,
2066 #[doc = "In auto takeoff mode"]
2067 MODE_HORSEFLY_AUTO_TAKEOFF = 1,
2068 #[doc = "In auto landing mode"]
2069 MODE_HORSEFLY_AUTO_LANDING = 2,
2070 #[doc = "In go home mode"]
2071 MODE_HORSEFLY_NAVI_GO_HOME = 3,
2072 #[doc = "In drop mode"]
2073 MODE_HORSEFLY_DROP = 4,
2074}
2075impl AvssHorseflyOperationMode {
2076 pub const DEFAULT: Self = Self::MODE_HORSEFLY_MANUAL_CTRL;
2077}
2078impl Default for AvssHorseflyOperationMode {
2079 fn default() -> Self {
2080 Self::DEFAULT
2081 }
2082}
2083#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2084#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2085#[cfg_attr(feature = "serde", serde(tag = "type"))]
2086#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2087#[repr(u32)]
2088#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
2089pub enum RebootShutdownConditions {
2090 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
2091 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
2092 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
2093 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
2094}
2095impl RebootShutdownConditions {
2096 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
2097}
2098impl Default for RebootShutdownConditions {
2099 fn default() -> Self {
2100 Self::DEFAULT
2101 }
2102}
2103#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2104#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2105#[cfg_attr(feature = "serde", serde(tag = "type"))]
2106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2107#[repr(u32)]
2108#[doc = "Direction of VTOL transition"]
2109pub enum VtolTransitionHeading {
2110 #[doc = "Respect the heading configuration of the vehicle."]
2111 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
2112 #[doc = "Use the heading pointing towards the next waypoint."]
2113 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
2114 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
2115 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
2116 #[doc = "Use the specified heading in parameter 4."]
2117 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
2118 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
2119 VTOL_TRANSITION_HEADING_ANY = 4,
2120}
2121impl VtolTransitionHeading {
2122 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
2123}
2124impl Default for VtolTransitionHeading {
2125 fn default() -> Self {
2126 Self::DEFAULT
2127 }
2128}
2129bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
2130impl SerialControlFlag {
2131 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
2132}
2133impl Default for SerialControlFlag {
2134 fn default() -> Self {
2135 Self::DEFAULT
2136 }
2137}
2138#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2139#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2140#[cfg_attr(feature = "serde", serde(tag = "type"))]
2141#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2142#[repr(u32)]
2143#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2144pub enum MavGoto {
2145 #[doc = "Hold at the current position."]
2146 MAV_GOTO_DO_HOLD = 0,
2147 #[doc = "Continue with the next item in mission execution."]
2148 MAV_GOTO_DO_CONTINUE = 1,
2149 #[doc = "Hold at the current position of the system"]
2150 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2151 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2152 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2153}
2154impl MavGoto {
2155 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2156}
2157impl Default for MavGoto {
2158 fn default() -> Self {
2159 Self::DEFAULT
2160 }
2161}
2162bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
2163impl CameraCapFlags {
2164 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
2165}
2166impl Default for CameraCapFlags {
2167 fn default() -> Self {
2168 Self::DEFAULT
2169 }
2170}
2171#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2172#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2173#[cfg_attr(feature = "serde", serde(tag = "type"))]
2174#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2175#[repr(u32)]
2176pub enum MavState {
2177 #[doc = "Uninitialized system, state is unknown."]
2178 MAV_STATE_UNINIT = 0,
2179 #[doc = "System is booting up."]
2180 MAV_STATE_BOOT = 1,
2181 #[doc = "System is calibrating and not flight-ready."]
2182 MAV_STATE_CALIBRATING = 2,
2183 #[doc = "System is grounded and on standby. It can be launched any time."]
2184 MAV_STATE_STANDBY = 3,
2185 #[doc = "System is active and might be already airborne. Motors are engaged."]
2186 MAV_STATE_ACTIVE = 4,
2187 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
2188 MAV_STATE_CRITICAL = 5,
2189 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
2190 MAV_STATE_EMERGENCY = 6,
2191 #[doc = "System just initialized its power-down sequence, will shut down now."]
2192 MAV_STATE_POWEROFF = 7,
2193 #[doc = "System is terminating itself (failsafe or commanded)."]
2194 MAV_STATE_FLIGHT_TERMINATION = 8,
2195}
2196impl MavState {
2197 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
2198}
2199impl Default for MavState {
2200 fn default() -> Self {
2201 Self::DEFAULT
2202 }
2203}
2204#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2205#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2206#[cfg_attr(feature = "serde", serde(tag = "type"))]
2207#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2208#[repr(u32)]
2209#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
2210pub enum AutotuneAxis {
2211 #[doc = "Autotune roll axis."]
2212 AUTOTUNE_AXIS_ROLL = 1,
2213 #[doc = "Autotune pitch axis."]
2214 AUTOTUNE_AXIS_PITCH = 2,
2215 #[doc = "Autotune yaw axis."]
2216 AUTOTUNE_AXIS_YAW = 4,
2217}
2218impl AutotuneAxis {
2219 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
2220}
2221impl Default for AutotuneAxis {
2222 fn default() -> Self {
2223 Self::DEFAULT
2224 }
2225}
2226bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
2227impl HilSensorUpdatedFlags {
2228 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
2229}
2230impl Default for HilSensorUpdatedFlags {
2231 fn default() -> Self {
2232 Self::DEFAULT
2233 }
2234}
2235#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2236#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2237#[cfg_attr(feature = "serde", serde(tag = "type"))]
2238#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2239#[repr(u32)]
2240#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
2241pub enum RcSubType {
2242 #[doc = "Spektrum DSM2"]
2243 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
2244 #[doc = "Spektrum DSMX"]
2245 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
2246 #[doc = "Spektrum DSMX8"]
2247 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
2248}
2249impl RcSubType {
2250 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
2251}
2252impl Default for RcSubType {
2253 fn default() -> Self {
2254 Self::DEFAULT
2255 }
2256}
2257bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
2258impl IlluminatorErrorFlags {
2259 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
2260}
2261impl Default for IlluminatorErrorFlags {
2262 fn default() -> Self {
2263 Self::DEFAULT
2264 }
2265}
2266bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
2267impl EstimatorStatusFlags {
2268 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
2269}
2270impl Default for EstimatorStatusFlags {
2271 fn default() -> Self {
2272 Self::DEFAULT
2273 }
2274}
2275#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2276#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2277#[cfg_attr(feature = "serde", serde(tag = "type"))]
2278#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2279#[repr(u32)]
2280#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2281pub enum MavModeFlagDecodePosition {
2282 #[doc = "First bit: 10000000"]
2283 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2284 #[doc = "Second bit: 01000000"]
2285 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2286 #[doc = "Third bit: 00100000"]
2287 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2288 #[doc = "Fourth bit: 00010000"]
2289 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2290 #[doc = "Fifth bit: 00001000"]
2291 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2292 #[doc = "Sixth bit: 00000100"]
2293 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2294 #[doc = "Seventh bit: 00000010"]
2295 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2296 #[doc = "Eighth bit: 00000001"]
2297 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2298}
2299impl MavModeFlagDecodePosition {
2300 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2301}
2302impl Default for MavModeFlagDecodePosition {
2303 fn default() -> Self {
2304 Self::DEFAULT
2305 }
2306}
2307#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2308#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2309#[cfg_attr(feature = "serde", serde(tag = "type"))]
2310#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2311#[repr(u32)]
2312#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
2313pub enum FirmwareVersionType {
2314 #[doc = "development release"]
2315 FIRMWARE_VERSION_TYPE_DEV = 0,
2316 #[doc = "alpha release"]
2317 FIRMWARE_VERSION_TYPE_ALPHA = 64,
2318 #[doc = "beta release"]
2319 FIRMWARE_VERSION_TYPE_BETA = 128,
2320 #[doc = "release candidate"]
2321 FIRMWARE_VERSION_TYPE_RC = 192,
2322 #[doc = "official stable release"]
2323 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
2324}
2325impl FirmwareVersionType {
2326 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
2327}
2328impl Default for FirmwareVersionType {
2329 fn default() -> Self {
2330 Self::DEFAULT
2331 }
2332}
2333#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2334#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2335#[cfg_attr(feature = "serde", serde(tag = "type"))]
2336#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2337#[repr(u32)]
2338#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2339pub enum MavMissionResult {
2340 #[doc = "mission accepted OK"]
2341 MAV_MISSION_ACCEPTED = 0,
2342 #[doc = "Generic error / not accepting mission commands at all right now."]
2343 MAV_MISSION_ERROR = 1,
2344 #[doc = "Coordinate frame is not supported."]
2345 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2346 #[doc = "Command is not supported."]
2347 MAV_MISSION_UNSUPPORTED = 3,
2348 #[doc = "Mission items exceed storage space."]
2349 MAV_MISSION_NO_SPACE = 4,
2350 #[doc = "One of the parameters has an invalid value."]
2351 MAV_MISSION_INVALID = 5,
2352 #[doc = "param1 has an invalid value."]
2353 MAV_MISSION_INVALID_PARAM1 = 6,
2354 #[doc = "param2 has an invalid value."]
2355 MAV_MISSION_INVALID_PARAM2 = 7,
2356 #[doc = "param3 has an invalid value."]
2357 MAV_MISSION_INVALID_PARAM3 = 8,
2358 #[doc = "param4 has an invalid value."]
2359 MAV_MISSION_INVALID_PARAM4 = 9,
2360 #[doc = "x / param5 has an invalid value."]
2361 MAV_MISSION_INVALID_PARAM5_X = 10,
2362 #[doc = "y / param6 has an invalid value."]
2363 MAV_MISSION_INVALID_PARAM6_Y = 11,
2364 #[doc = "z / param7 has an invalid value."]
2365 MAV_MISSION_INVALID_PARAM7 = 12,
2366 #[doc = "Mission item received out of sequence"]
2367 MAV_MISSION_INVALID_SEQUENCE = 13,
2368 #[doc = "Not accepting any mission commands from this communication partner."]
2369 MAV_MISSION_DENIED = 14,
2370 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2371 MAV_MISSION_OPERATION_CANCELLED = 15,
2372}
2373impl MavMissionResult {
2374 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2375}
2376impl Default for MavMissionResult {
2377 fn default() -> Self {
2378 Self::DEFAULT
2379 }
2380}
2381#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2383#[cfg_attr(feature = "serde", serde(tag = "type"))]
2384#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2385#[repr(u32)]
2386#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2387pub enum MavFuelType {
2388 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2389 MAV_FUEL_TYPE_UNKNOWN = 0,
2390 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2391 MAV_FUEL_TYPE_LIQUID = 1,
2392 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2393 MAV_FUEL_TYPE_GAS = 2,
2394}
2395impl MavFuelType {
2396 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2397}
2398impl Default for MavFuelType {
2399 fn default() -> Self {
2400 Self::DEFAULT
2401 }
2402}
2403bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
2404impl GimbalDeviceErrorFlags {
2405 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
2406}
2407impl Default for GimbalDeviceErrorFlags {
2408 fn default() -> Self {
2409 Self::DEFAULT
2410 }
2411}
2412#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2413#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2414#[cfg_attr(feature = "serde", serde(tag = "type"))]
2415#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2416#[repr(u32)]
2417#[doc = "Actions being taken to mitigate/prevent fence breach"]
2418pub enum FenceMitigate {
2419 #[doc = "Unknown"]
2420 FENCE_MITIGATE_UNKNOWN = 0,
2421 #[doc = "No actions being taken"]
2422 FENCE_MITIGATE_NONE = 1,
2423 #[doc = "Velocity limiting active to prevent breach"]
2424 FENCE_MITIGATE_VEL_LIMIT = 2,
2425}
2426impl FenceMitigate {
2427 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
2428}
2429impl Default for FenceMitigate {
2430 fn default() -> Self {
2431 Self::DEFAULT
2432 }
2433}
2434#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2435#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2436#[cfg_attr(feature = "serde", serde(tag = "type"))]
2437#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2438#[repr(u32)]
2439pub enum MavOdidDescType {
2440 #[doc = "Optional free-form text description of the purpose of the flight."]
2441 MAV_ODID_DESC_TYPE_TEXT = 0,
2442 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2443 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2444 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2445 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2446}
2447impl MavOdidDescType {
2448 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2449}
2450impl Default for MavOdidDescType {
2451 fn default() -> Self {
2452 Self::DEFAULT
2453 }
2454}
2455#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2456#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2457#[cfg_attr(feature = "serde", serde(tag = "type"))]
2458#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2459#[repr(u32)]
2460#[doc = "Cellular network radio type"]
2461pub enum CellularNetworkRadioType {
2462 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
2463 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
2464 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
2465 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
2466 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
2467}
2468impl CellularNetworkRadioType {
2469 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
2470}
2471impl Default for CellularNetworkRadioType {
2472 fn default() -> Self {
2473 Self::DEFAULT
2474 }
2475}
2476#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2477#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2478#[cfg_attr(feature = "serde", serde(tag = "type"))]
2479#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2480#[repr(u32)]
2481pub enum NavVtolLandOptions {
2482 #[doc = "Default autopilot landing behaviour."]
2483 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
2484 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
2485 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
2486 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
2487 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
2488}
2489impl NavVtolLandOptions {
2490 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
2491}
2492impl Default for NavVtolLandOptions {
2493 fn default() -> Self {
2494 Self::DEFAULT
2495 }
2496}
2497#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2498#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2499#[cfg_attr(feature = "serde", serde(tag = "type"))]
2500#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2501#[repr(u32)]
2502#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
2503pub enum RcType {
2504 #[doc = "Spektrum"]
2505 RC_TYPE_SPEKTRUM = 0,
2506 #[doc = "CRSF"]
2507 RC_TYPE_CRSF = 1,
2508}
2509impl RcType {
2510 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
2511}
2512impl Default for RcType {
2513 fn default() -> Self {
2514 Self::DEFAULT
2515 }
2516}
2517bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
2518impl GimbalDeviceCapFlags {
2519 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
2520}
2521impl Default for GimbalDeviceCapFlags {
2522 fn default() -> Self {
2523 Self::DEFAULT
2524 }
2525}
2526bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2527impl MavModeProperty {
2528 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2529}
2530impl Default for MavModeProperty {
2531 fn default() -> Self {
2532 Self::DEFAULT
2533 }
2534}
2535#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2536#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2537#[cfg_attr(feature = "serde", serde(tag = "type"))]
2538#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2539#[repr(u32)]
2540pub enum MavOdidStatus {
2541 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
2542 MAV_ODID_STATUS_UNDECLARED = 0,
2543 #[doc = "The UA is on the ground."]
2544 MAV_ODID_STATUS_GROUND = 1,
2545 #[doc = "The UA is in the air."]
2546 MAV_ODID_STATUS_AIRBORNE = 2,
2547 #[doc = "The UA is having an emergency."]
2548 MAV_ODID_STATUS_EMERGENCY = 3,
2549 #[doc = "The remote ID system is failing or unreliable in some way."]
2550 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
2551}
2552impl MavOdidStatus {
2553 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
2554}
2555impl Default for MavOdidStatus {
2556 fn default() -> Self {
2557 Self::DEFAULT
2558 }
2559}
2560bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
2561impl AttitudeTargetTypemask {
2562 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
2563}
2564impl Default for AttitudeTargetTypemask {
2565 fn default() -> Self {
2566 Self::DEFAULT
2567 }
2568}
2569#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2570#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2571#[cfg_attr(feature = "serde", serde(tag = "type"))]
2572#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2573#[repr(u32)]
2574#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
2575pub enum SpeedType {
2576 #[doc = "Airspeed"]
2577 SPEED_TYPE_AIRSPEED = 0,
2578 #[doc = "Groundspeed"]
2579 SPEED_TYPE_GROUNDSPEED = 1,
2580 #[doc = "Climb speed"]
2581 SPEED_TYPE_CLIMB_SPEED = 2,
2582 #[doc = "Descent speed"]
2583 SPEED_TYPE_DESCENT_SPEED = 3,
2584}
2585impl SpeedType {
2586 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
2587}
2588impl Default for SpeedType {
2589 fn default() -> Self {
2590 Self::DEFAULT
2591 }
2592}
2593bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2594impl MavModeFlag {
2595 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2596}
2597impl Default for MavModeFlag {
2598 fn default() -> Self {
2599 Self::DEFAULT
2600 }
2601}
2602#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2603#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2604#[cfg_attr(feature = "serde", serde(tag = "type"))]
2605#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2606#[repr(u32)]
2607#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
2608pub enum AisType {
2609 #[doc = "Not available (default)."]
2610 AIS_TYPE_UNKNOWN = 0,
2611 AIS_TYPE_RESERVED_1 = 1,
2612 AIS_TYPE_RESERVED_2 = 2,
2613 AIS_TYPE_RESERVED_3 = 3,
2614 AIS_TYPE_RESERVED_4 = 4,
2615 AIS_TYPE_RESERVED_5 = 5,
2616 AIS_TYPE_RESERVED_6 = 6,
2617 AIS_TYPE_RESERVED_7 = 7,
2618 AIS_TYPE_RESERVED_8 = 8,
2619 AIS_TYPE_RESERVED_9 = 9,
2620 AIS_TYPE_RESERVED_10 = 10,
2621 AIS_TYPE_RESERVED_11 = 11,
2622 AIS_TYPE_RESERVED_12 = 12,
2623 AIS_TYPE_RESERVED_13 = 13,
2624 AIS_TYPE_RESERVED_14 = 14,
2625 AIS_TYPE_RESERVED_15 = 15,
2626 AIS_TYPE_RESERVED_16 = 16,
2627 AIS_TYPE_RESERVED_17 = 17,
2628 AIS_TYPE_RESERVED_18 = 18,
2629 AIS_TYPE_RESERVED_19 = 19,
2630 #[doc = "Wing In Ground effect."]
2631 AIS_TYPE_WIG = 20,
2632 AIS_TYPE_WIG_HAZARDOUS_A = 21,
2633 AIS_TYPE_WIG_HAZARDOUS_B = 22,
2634 AIS_TYPE_WIG_HAZARDOUS_C = 23,
2635 AIS_TYPE_WIG_HAZARDOUS_D = 24,
2636 AIS_TYPE_WIG_RESERVED_1 = 25,
2637 AIS_TYPE_WIG_RESERVED_2 = 26,
2638 AIS_TYPE_WIG_RESERVED_3 = 27,
2639 AIS_TYPE_WIG_RESERVED_4 = 28,
2640 AIS_TYPE_WIG_RESERVED_5 = 29,
2641 AIS_TYPE_FISHING = 30,
2642 AIS_TYPE_TOWING = 31,
2643 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
2644 AIS_TYPE_TOWING_LARGE = 32,
2645 #[doc = "Dredging or other underwater ops."]
2646 AIS_TYPE_DREDGING = 33,
2647 AIS_TYPE_DIVING = 34,
2648 AIS_TYPE_MILITARY = 35,
2649 AIS_TYPE_SAILING = 36,
2650 AIS_TYPE_PLEASURE = 37,
2651 AIS_TYPE_RESERVED_20 = 38,
2652 AIS_TYPE_RESERVED_21 = 39,
2653 #[doc = "High Speed Craft."]
2654 AIS_TYPE_HSC = 40,
2655 AIS_TYPE_HSC_HAZARDOUS_A = 41,
2656 AIS_TYPE_HSC_HAZARDOUS_B = 42,
2657 AIS_TYPE_HSC_HAZARDOUS_C = 43,
2658 AIS_TYPE_HSC_HAZARDOUS_D = 44,
2659 AIS_TYPE_HSC_RESERVED_1 = 45,
2660 AIS_TYPE_HSC_RESERVED_2 = 46,
2661 AIS_TYPE_HSC_RESERVED_3 = 47,
2662 AIS_TYPE_HSC_RESERVED_4 = 48,
2663 AIS_TYPE_HSC_UNKNOWN = 49,
2664 AIS_TYPE_PILOT = 50,
2665 #[doc = "Search And Rescue vessel."]
2666 AIS_TYPE_SAR = 51,
2667 AIS_TYPE_TUG = 52,
2668 AIS_TYPE_PORT_TENDER = 53,
2669 #[doc = "Anti-pollution equipment."]
2670 AIS_TYPE_ANTI_POLLUTION = 54,
2671 AIS_TYPE_LAW_ENFORCEMENT = 55,
2672 AIS_TYPE_SPARE_LOCAL_1 = 56,
2673 AIS_TYPE_SPARE_LOCAL_2 = 57,
2674 AIS_TYPE_MEDICAL_TRANSPORT = 58,
2675 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
2676 AIS_TYPE_NONECOMBATANT = 59,
2677 AIS_TYPE_PASSENGER = 60,
2678 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
2679 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
2680 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
2681 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
2682 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
2683 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
2684 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
2685 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
2686 AIS_TYPE_PASSENGER_UNKNOWN = 69,
2687 AIS_TYPE_CARGO = 70,
2688 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
2689 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
2690 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
2691 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
2692 AIS_TYPE_CARGO_RESERVED_1 = 75,
2693 AIS_TYPE_CARGO_RESERVED_2 = 76,
2694 AIS_TYPE_CARGO_RESERVED_3 = 77,
2695 AIS_TYPE_CARGO_RESERVED_4 = 78,
2696 AIS_TYPE_CARGO_UNKNOWN = 79,
2697 AIS_TYPE_TANKER = 80,
2698 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
2699 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
2700 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
2701 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
2702 AIS_TYPE_TANKER_RESERVED_1 = 85,
2703 AIS_TYPE_TANKER_RESERVED_2 = 86,
2704 AIS_TYPE_TANKER_RESERVED_3 = 87,
2705 AIS_TYPE_TANKER_RESERVED_4 = 88,
2706 AIS_TYPE_TANKER_UNKNOWN = 89,
2707 AIS_TYPE_OTHER = 90,
2708 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
2709 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
2710 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
2711 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
2712 AIS_TYPE_OTHER_RESERVED_1 = 95,
2713 AIS_TYPE_OTHER_RESERVED_2 = 96,
2714 AIS_TYPE_OTHER_RESERVED_3 = 97,
2715 AIS_TYPE_OTHER_RESERVED_4 = 98,
2716 AIS_TYPE_OTHER_UNKNOWN = 99,
2717}
2718impl AisType {
2719 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
2720}
2721impl Default for AisType {
2722 fn default() -> Self {
2723 Self::DEFAULT
2724 }
2725}
2726#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2727#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2728#[cfg_attr(feature = "serde", serde(tag = "type"))]
2729#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2730#[repr(u32)]
2731#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2732pub enum MavMode {
2733 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2734 MAV_MODE_PREFLIGHT = 0,
2735 #[doc = "System is allowed to be active, under assisted RC control."]
2736 MAV_MODE_STABILIZE_DISARMED = 80,
2737 #[doc = "System is allowed to be active, under assisted RC control."]
2738 MAV_MODE_STABILIZE_ARMED = 208,
2739 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2740 MAV_MODE_MANUAL_DISARMED = 64,
2741 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2742 MAV_MODE_MANUAL_ARMED = 192,
2743 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2744 MAV_MODE_GUIDED_DISARMED = 88,
2745 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2746 MAV_MODE_GUIDED_ARMED = 216,
2747 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2748 MAV_MODE_AUTO_DISARMED = 92,
2749 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2750 MAV_MODE_AUTO_ARMED = 220,
2751 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2752 MAV_MODE_TEST_DISARMED = 66,
2753 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2754 MAV_MODE_TEST_ARMED = 194,
2755}
2756impl MavMode {
2757 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2758}
2759impl Default for MavMode {
2760 fn default() -> Self {
2761 Self::DEFAULT
2762 }
2763}
2764bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
2765impl CameraTrackingTargetData {
2766 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
2767}
2768impl Default for CameraTrackingTargetData {
2769 fn default() -> Self {
2770 Self::DEFAULT
2771 }
2772}
2773bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
2774impl StorageUsageFlag {
2775 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
2776}
2777impl Default for StorageUsageFlag {
2778 fn default() -> Self {
2779 Self::DEFAULT
2780 }
2781}
2782#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2783#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2784#[cfg_attr(feature = "serde", serde(tag = "type"))]
2785#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2786#[repr(u32)]
2787#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
2788pub enum MavSeverity {
2789 #[doc = "System is unusable. This is a \"panic\" condition."]
2790 MAV_SEVERITY_EMERGENCY = 0,
2791 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
2792 MAV_SEVERITY_ALERT = 1,
2793 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
2794 MAV_SEVERITY_CRITICAL = 2,
2795 #[doc = "Indicates an error in secondary/redundant systems."]
2796 MAV_SEVERITY_ERROR = 3,
2797 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
2798 MAV_SEVERITY_WARNING = 4,
2799 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
2800 MAV_SEVERITY_NOTICE = 5,
2801 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
2802 MAV_SEVERITY_INFO = 6,
2803 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
2804 MAV_SEVERITY_DEBUG = 7,
2805}
2806impl MavSeverity {
2807 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
2808}
2809impl Default for MavSeverity {
2810 fn default() -> Self {
2811 Self::DEFAULT
2812 }
2813}
2814#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2815#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2816#[cfg_attr(feature = "serde", serde(tag = "type"))]
2817#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2818#[repr(u32)]
2819#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
2820pub enum CellularNetworkFailedReason {
2821 #[doc = "No error"]
2822 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
2823 #[doc = "Error state is unknown"]
2824 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
2825 #[doc = "SIM is required for the modem but missing"]
2826 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
2827 #[doc = "SIM is available, but not usable for connection"]
2828 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
2829}
2830impl CellularNetworkFailedReason {
2831 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
2832}
2833impl Default for CellularNetworkFailedReason {
2834 fn default() -> Self {
2835 Self::DEFAULT
2836 }
2837}
2838#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2839#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2840#[cfg_attr(feature = "serde", serde(tag = "type"))]
2841#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2842#[repr(u32)]
2843#[doc = "Camera Modes."]
2844pub enum CameraMode {
2845 #[doc = "Camera is in image/photo capture mode."]
2846 CAMERA_MODE_IMAGE = 0,
2847 #[doc = "Camera is in video capture mode."]
2848 CAMERA_MODE_VIDEO = 1,
2849 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
2850 CAMERA_MODE_IMAGE_SURVEY = 2,
2851}
2852impl CameraMode {
2853 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
2854}
2855impl Default for CameraMode {
2856 fn default() -> Self {
2857 Self::DEFAULT
2858 }
2859}
2860#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2861#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2862#[cfg_attr(feature = "serde", serde(tag = "type"))]
2863#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2864#[repr(u32)]
2865#[doc = "Specifies the datatype of a MAVLink extended parameter."]
2866pub enum MavParamExtType {
2867 #[doc = "8-bit unsigned integer"]
2868 MAV_PARAM_EXT_TYPE_UINT8 = 1,
2869 #[doc = "8-bit signed integer"]
2870 MAV_PARAM_EXT_TYPE_INT8 = 2,
2871 #[doc = "16-bit unsigned integer"]
2872 MAV_PARAM_EXT_TYPE_UINT16 = 3,
2873 #[doc = "16-bit signed integer"]
2874 MAV_PARAM_EXT_TYPE_INT16 = 4,
2875 #[doc = "32-bit unsigned integer"]
2876 MAV_PARAM_EXT_TYPE_UINT32 = 5,
2877 #[doc = "32-bit signed integer"]
2878 MAV_PARAM_EXT_TYPE_INT32 = 6,
2879 #[doc = "64-bit unsigned integer"]
2880 MAV_PARAM_EXT_TYPE_UINT64 = 7,
2881 #[doc = "64-bit signed integer"]
2882 MAV_PARAM_EXT_TYPE_INT64 = 8,
2883 #[doc = "32-bit floating-point"]
2884 MAV_PARAM_EXT_TYPE_REAL32 = 9,
2885 #[doc = "64-bit floating-point"]
2886 MAV_PARAM_EXT_TYPE_REAL64 = 10,
2887 #[doc = "Custom Type"]
2888 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
2889}
2890impl MavParamExtType {
2891 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
2892}
2893impl Default for MavParamExtType {
2894 fn default() -> Self {
2895 Self::DEFAULT
2896 }
2897}
2898#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2899#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2900#[cfg_attr(feature = "serde", serde(tag = "type"))]
2901#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2902#[repr(u32)]
2903#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2904pub enum MavDataStream {
2905 #[doc = "Enable all data streams"]
2906 MAV_DATA_STREAM_ALL = 0,
2907 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2908 MAV_DATA_STREAM_RAW_SENSORS = 1,
2909 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2910 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2911 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2912 MAV_DATA_STREAM_RC_CHANNELS = 3,
2913 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2914 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2915 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2916 MAV_DATA_STREAM_POSITION = 6,
2917 #[doc = "Dependent on the autopilot"]
2918 MAV_DATA_STREAM_EXTRA1 = 10,
2919 #[doc = "Dependent on the autopilot"]
2920 MAV_DATA_STREAM_EXTRA2 = 11,
2921 #[doc = "Dependent on the autopilot"]
2922 MAV_DATA_STREAM_EXTRA3 = 12,
2923}
2924impl MavDataStream {
2925 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2926}
2927impl Default for MavDataStream {
2928 fn default() -> Self {
2929 Self::DEFAULT
2930 }
2931}
2932#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2933#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2934#[cfg_attr(feature = "serde", serde(tag = "type"))]
2935#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2936#[repr(u32)]
2937#[doc = "Type of GPS fix"]
2938pub enum GpsFixType {
2939 #[doc = "No GPS connected"]
2940 GPS_FIX_TYPE_NO_GPS = 0,
2941 #[doc = "No position information, GPS is connected"]
2942 GPS_FIX_TYPE_NO_FIX = 1,
2943 #[doc = "2D position"]
2944 GPS_FIX_TYPE_2D_FIX = 2,
2945 #[doc = "3D position"]
2946 GPS_FIX_TYPE_3D_FIX = 3,
2947 #[doc = "DGPS/SBAS aided 3D position"]
2948 GPS_FIX_TYPE_DGPS = 4,
2949 #[doc = "RTK float, 3D position"]
2950 GPS_FIX_TYPE_RTK_FLOAT = 5,
2951 #[doc = "RTK Fixed, 3D position"]
2952 GPS_FIX_TYPE_RTK_FIXED = 6,
2953 #[doc = "Static fixed, typically used for base stations"]
2954 GPS_FIX_TYPE_STATIC = 7,
2955 #[doc = "PPP, 3D position."]
2956 GPS_FIX_TYPE_PPP = 8,
2957}
2958impl GpsFixType {
2959 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
2960}
2961impl Default for GpsFixType {
2962 fn default() -> Self {
2963 Self::DEFAULT
2964 }
2965}
2966#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2967#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2968#[cfg_attr(feature = "serde", serde(tag = "type"))]
2969#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2970#[repr(u32)]
2971#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
2972pub enum ActuatorConfiguration {
2973 #[doc = "Do nothing."]
2974 ACTUATOR_CONFIGURATION_NONE = 0,
2975 #[doc = "Command the actuator to beep now."]
2976 ACTUATOR_CONFIGURATION_BEEP = 1,
2977 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
2978 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
2979 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
2980 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
2981 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
2982 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
2983 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
2984 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
2985}
2986impl ActuatorConfiguration {
2987 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
2988}
2989impl Default for ActuatorConfiguration {
2990 fn default() -> Self {
2991 Self::DEFAULT
2992 }
2993}
2994#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2995#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2996#[cfg_attr(feature = "serde", serde(tag = "type"))]
2997#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2998#[repr(u32)]
2999#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3000pub enum MavRoi {
3001 #[doc = "No region of interest."]
3002 MAV_ROI_NONE = 0,
3003 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3004 MAV_ROI_WPNEXT = 1,
3005 #[doc = "Point toward given waypoint."]
3006 MAV_ROI_WPINDEX = 2,
3007 #[doc = "Point toward fixed location."]
3008 MAV_ROI_LOCATION = 3,
3009 #[doc = "Point toward of given id."]
3010 MAV_ROI_TARGET = 4,
3011}
3012impl MavRoi {
3013 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3014}
3015impl Default for MavRoi {
3016 fn default() -> Self {
3017 Self::DEFAULT
3018 }
3019}
3020bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3021impl MavSysStatusSensor {
3022 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3023}
3024impl Default for MavSysStatusSensor {
3025 fn default() -> Self {
3026 Self::DEFAULT
3027 }
3028}
3029#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3030#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3031#[cfg_attr(feature = "serde", serde(tag = "type"))]
3032#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3033#[repr(u32)]
3034pub enum MavOdidArmStatus {
3035 #[doc = "Passing arming checks."]
3036 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
3037 #[doc = "Generic arming failure, see error string for details."]
3038 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
3039}
3040impl MavOdidArmStatus {
3041 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
3042}
3043impl Default for MavOdidArmStatus {
3044 fn default() -> Self {
3045 Self::DEFAULT
3046 }
3047}
3048#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3049#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3050#[cfg_attr(feature = "serde", serde(tag = "type"))]
3051#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3052#[repr(u32)]
3053pub enum MavOdidAuthType {
3054 #[doc = "No authentication type is specified."]
3055 MAV_ODID_AUTH_TYPE_NONE = 0,
3056 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
3057 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
3058 #[doc = "Signature for the Operator ID."]
3059 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
3060 #[doc = "Signature for the entire message set."]
3061 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
3062 #[doc = "Authentication is provided by Network Remote ID."]
3063 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
3064 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
3065 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
3066}
3067impl MavOdidAuthType {
3068 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
3069}
3070impl Default for MavOdidAuthType {
3071 fn default() -> Self {
3072 Self::DEFAULT
3073 }
3074}
3075#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3076#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3077#[cfg_attr(feature = "serde", serde(tag = "type"))]
3078#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3079#[repr(u32)]
3080#[doc = "SERIAL_CONTROL device types"]
3081pub enum SerialControlDev {
3082 #[doc = "First telemetry port"]
3083 SERIAL_CONTROL_DEV_TELEM1 = 0,
3084 #[doc = "Second telemetry port"]
3085 SERIAL_CONTROL_DEV_TELEM2 = 1,
3086 #[doc = "First GPS port"]
3087 SERIAL_CONTROL_DEV_GPS1 = 2,
3088 #[doc = "Second GPS port"]
3089 SERIAL_CONTROL_DEV_GPS2 = 3,
3090 #[doc = "system shell"]
3091 SERIAL_CONTROL_DEV_SHELL = 10,
3092 #[doc = "SERIAL0"]
3093 SERIAL_CONTROL_SERIAL0 = 100,
3094 #[doc = "SERIAL1"]
3095 SERIAL_CONTROL_SERIAL1 = 101,
3096 #[doc = "SERIAL2"]
3097 SERIAL_CONTROL_SERIAL2 = 102,
3098 #[doc = "SERIAL3"]
3099 SERIAL_CONTROL_SERIAL3 = 103,
3100 #[doc = "SERIAL4"]
3101 SERIAL_CONTROL_SERIAL4 = 104,
3102 #[doc = "SERIAL5"]
3103 SERIAL_CONTROL_SERIAL5 = 105,
3104 #[doc = "SERIAL6"]
3105 SERIAL_CONTROL_SERIAL6 = 106,
3106 #[doc = "SERIAL7"]
3107 SERIAL_CONTROL_SERIAL7 = 107,
3108 #[doc = "SERIAL8"]
3109 SERIAL_CONTROL_SERIAL8 = 108,
3110 #[doc = "SERIAL9"]
3111 SERIAL_CONTROL_SERIAL9 = 109,
3112}
3113impl SerialControlDev {
3114 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
3115}
3116impl Default for SerialControlDev {
3117 fn default() -> Self {
3118 Self::DEFAULT
3119 }
3120}
3121#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3122#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3123#[cfg_attr(feature = "serde", serde(tag = "type"))]
3124#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3125#[repr(u32)]
3126#[doc = "Enumeration of sensor orientation, according to its rotations"]
3127pub enum MavSensorOrientation {
3128 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3129 MAV_SENSOR_ROTATION_NONE = 0,
3130 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3131 MAV_SENSOR_ROTATION_YAW_45 = 1,
3132 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3133 MAV_SENSOR_ROTATION_YAW_90 = 2,
3134 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3135 MAV_SENSOR_ROTATION_YAW_135 = 3,
3136 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3137 MAV_SENSOR_ROTATION_YAW_180 = 4,
3138 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3139 MAV_SENSOR_ROTATION_YAW_225 = 5,
3140 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3141 MAV_SENSOR_ROTATION_YAW_270 = 6,
3142 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3143 MAV_SENSOR_ROTATION_YAW_315 = 7,
3144 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3145 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3146 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3147 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3148 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3149 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3150 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3151 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3152 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3153 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3154 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3155 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3156 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3157 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3158 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3159 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3160 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3161 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3162 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3163 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3164 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3165 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3166 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3167 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3168 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3169 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3170 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3171 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3172 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3173 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3174 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3175 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3176 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3177 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3178 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3179 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3180 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3181 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3182 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3183 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3184 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3185 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3186 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3187 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3188 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3189 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3190 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3191 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3192 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3193 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3194 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3195 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3196 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3197 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3198 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3199 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3200 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3201 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3202 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3203 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3204 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3205 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3206 #[doc = "Pitch: 315"]
3207 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3208 #[doc = "Roll: 90, Pitch: 315"]
3209 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3210 #[doc = "Custom orientation"]
3211 MAV_SENSOR_ROTATION_CUSTOM = 100,
3212}
3213impl MavSensorOrientation {
3214 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3215}
3216impl Default for MavSensorOrientation {
3217 fn default() -> Self {
3218 Self::DEFAULT
3219 }
3220}
3221bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
3222impl EscFailureFlags {
3223 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
3224}
3225impl Default for EscFailureFlags {
3226 fn default() -> Self {
3227 Self::DEFAULT
3228 }
3229}
3230#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3231#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3232#[cfg_attr(feature = "serde", serde(tag = "type"))]
3233#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3234#[repr(u32)]
3235#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
3236pub enum MavComponent {
3237 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
3238 MAV_COMP_ID_ALL = 0,
3239 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
3240 MAV_COMP_ID_AUTOPILOT1 = 1,
3241 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3242 MAV_COMP_ID_USER1 = 25,
3243 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3244 MAV_COMP_ID_USER2 = 26,
3245 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3246 MAV_COMP_ID_USER3 = 27,
3247 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3248 MAV_COMP_ID_USER4 = 28,
3249 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3250 MAV_COMP_ID_USER5 = 29,
3251 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3252 MAV_COMP_ID_USER6 = 30,
3253 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3254 MAV_COMP_ID_USER7 = 31,
3255 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3256 MAV_COMP_ID_USER8 = 32,
3257 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3258 MAV_COMP_ID_USER9 = 33,
3259 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3260 MAV_COMP_ID_USER10 = 34,
3261 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3262 MAV_COMP_ID_USER11 = 35,
3263 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3264 MAV_COMP_ID_USER12 = 36,
3265 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3266 MAV_COMP_ID_USER13 = 37,
3267 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3268 MAV_COMP_ID_USER14 = 38,
3269 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3270 MAV_COMP_ID_USER15 = 39,
3271 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3272 MAV_COMP_ID_USER16 = 40,
3273 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3274 MAV_COMP_ID_USER17 = 41,
3275 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3276 MAV_COMP_ID_USER18 = 42,
3277 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3278 MAV_COMP_ID_USER19 = 43,
3279 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3280 MAV_COMP_ID_USER20 = 44,
3281 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3282 MAV_COMP_ID_USER21 = 45,
3283 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3284 MAV_COMP_ID_USER22 = 46,
3285 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3286 MAV_COMP_ID_USER23 = 47,
3287 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3288 MAV_COMP_ID_USER24 = 48,
3289 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3290 MAV_COMP_ID_USER25 = 49,
3291 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3292 MAV_COMP_ID_USER26 = 50,
3293 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3294 MAV_COMP_ID_USER27 = 51,
3295 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3296 MAV_COMP_ID_USER28 = 52,
3297 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3298 MAV_COMP_ID_USER29 = 53,
3299 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3300 MAV_COMP_ID_USER30 = 54,
3301 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3302 MAV_COMP_ID_USER31 = 55,
3303 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3304 MAV_COMP_ID_USER32 = 56,
3305 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3306 MAV_COMP_ID_USER33 = 57,
3307 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3308 MAV_COMP_ID_USER34 = 58,
3309 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3310 MAV_COMP_ID_USER35 = 59,
3311 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3312 MAV_COMP_ID_USER36 = 60,
3313 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3314 MAV_COMP_ID_USER37 = 61,
3315 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3316 MAV_COMP_ID_USER38 = 62,
3317 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3318 MAV_COMP_ID_USER39 = 63,
3319 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3320 MAV_COMP_ID_USER40 = 64,
3321 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3322 MAV_COMP_ID_USER41 = 65,
3323 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3324 MAV_COMP_ID_USER42 = 66,
3325 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3326 MAV_COMP_ID_USER43 = 67,
3327 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
3328 MAV_COMP_ID_TELEMETRY_RADIO = 68,
3329 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3330 MAV_COMP_ID_USER45 = 69,
3331 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3332 MAV_COMP_ID_USER46 = 70,
3333 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3334 MAV_COMP_ID_USER47 = 71,
3335 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3336 MAV_COMP_ID_USER48 = 72,
3337 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3338 MAV_COMP_ID_USER49 = 73,
3339 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3340 MAV_COMP_ID_USER50 = 74,
3341 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3342 MAV_COMP_ID_USER51 = 75,
3343 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3344 MAV_COMP_ID_USER52 = 76,
3345 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3346 MAV_COMP_ID_USER53 = 77,
3347 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3348 MAV_COMP_ID_USER54 = 78,
3349 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3350 MAV_COMP_ID_USER55 = 79,
3351 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3352 MAV_COMP_ID_USER56 = 80,
3353 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3354 MAV_COMP_ID_USER57 = 81,
3355 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3356 MAV_COMP_ID_USER58 = 82,
3357 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3358 MAV_COMP_ID_USER59 = 83,
3359 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3360 MAV_COMP_ID_USER60 = 84,
3361 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3362 MAV_COMP_ID_USER61 = 85,
3363 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3364 MAV_COMP_ID_USER62 = 86,
3365 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3366 MAV_COMP_ID_USER63 = 87,
3367 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3368 MAV_COMP_ID_USER64 = 88,
3369 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3370 MAV_COMP_ID_USER65 = 89,
3371 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3372 MAV_COMP_ID_USER66 = 90,
3373 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3374 MAV_COMP_ID_USER67 = 91,
3375 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3376 MAV_COMP_ID_USER68 = 92,
3377 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3378 MAV_COMP_ID_USER69 = 93,
3379 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3380 MAV_COMP_ID_USER70 = 94,
3381 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3382 MAV_COMP_ID_USER71 = 95,
3383 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3384 MAV_COMP_ID_USER72 = 96,
3385 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3386 MAV_COMP_ID_USER73 = 97,
3387 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3388 MAV_COMP_ID_USER74 = 98,
3389 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
3390 MAV_COMP_ID_USER75 = 99,
3391 #[doc = "Camera #1."]
3392 MAV_COMP_ID_CAMERA = 100,
3393 #[doc = "Camera #2."]
3394 MAV_COMP_ID_CAMERA2 = 101,
3395 #[doc = "Camera #3."]
3396 MAV_COMP_ID_CAMERA3 = 102,
3397 #[doc = "Camera #4."]
3398 MAV_COMP_ID_CAMERA4 = 103,
3399 #[doc = "Camera #5."]
3400 MAV_COMP_ID_CAMERA5 = 104,
3401 #[doc = "Camera #6."]
3402 MAV_COMP_ID_CAMERA6 = 105,
3403 #[doc = "Servo #1."]
3404 MAV_COMP_ID_SERVO1 = 140,
3405 #[doc = "Servo #2."]
3406 MAV_COMP_ID_SERVO2 = 141,
3407 #[doc = "Servo #3."]
3408 MAV_COMP_ID_SERVO3 = 142,
3409 #[doc = "Servo #4."]
3410 MAV_COMP_ID_SERVO4 = 143,
3411 #[doc = "Servo #5."]
3412 MAV_COMP_ID_SERVO5 = 144,
3413 #[doc = "Servo #6."]
3414 MAV_COMP_ID_SERVO6 = 145,
3415 #[doc = "Servo #7."]
3416 MAV_COMP_ID_SERVO7 = 146,
3417 #[doc = "Servo #8."]
3418 MAV_COMP_ID_SERVO8 = 147,
3419 #[doc = "Servo #9."]
3420 MAV_COMP_ID_SERVO9 = 148,
3421 #[doc = "Servo #10."]
3422 MAV_COMP_ID_SERVO10 = 149,
3423 #[doc = "Servo #11."]
3424 MAV_COMP_ID_SERVO11 = 150,
3425 #[doc = "Servo #12."]
3426 MAV_COMP_ID_SERVO12 = 151,
3427 #[doc = "Servo #13."]
3428 MAV_COMP_ID_SERVO13 = 152,
3429 #[doc = "Servo #14."]
3430 MAV_COMP_ID_SERVO14 = 153,
3431 #[doc = "Gimbal #1."]
3432 MAV_COMP_ID_GIMBAL = 154,
3433 #[doc = "Logging component."]
3434 MAV_COMP_ID_LOG = 155,
3435 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
3436 MAV_COMP_ID_ADSB = 156,
3437 #[doc = "On Screen Display (OSD) devices for video links."]
3438 MAV_COMP_ID_OSD = 157,
3439 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
3440 MAV_COMP_ID_PERIPHERAL = 158,
3441 #[doc = "Gimbal ID for QX1."]
3442 MAV_COMP_ID_QX1_GIMBAL = 159,
3443 #[doc = "FLARM collision alert component."]
3444 MAV_COMP_ID_FLARM = 160,
3445 #[doc = "Parachute component."]
3446 MAV_COMP_ID_PARACHUTE = 161,
3447 #[doc = "Winch component."]
3448 MAV_COMP_ID_WINCH = 169,
3449 #[doc = "Gimbal #2."]
3450 MAV_COMP_ID_GIMBAL2 = 171,
3451 #[doc = "Gimbal #3."]
3452 MAV_COMP_ID_GIMBAL3 = 172,
3453 #[doc = "Gimbal #4"]
3454 MAV_COMP_ID_GIMBAL4 = 173,
3455 #[doc = "Gimbal #5."]
3456 MAV_COMP_ID_GIMBAL5 = 174,
3457 #[doc = "Gimbal #6."]
3458 MAV_COMP_ID_GIMBAL6 = 175,
3459 #[doc = "Battery #1."]
3460 MAV_COMP_ID_BATTERY = 180,
3461 #[doc = "Battery #2."]
3462 MAV_COMP_ID_BATTERY2 = 181,
3463 #[doc = "CAN over MAVLink client."]
3464 MAV_COMP_ID_MAVCAN = 189,
3465 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
3466 MAV_COMP_ID_MISSIONPLANNER = 190,
3467 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
3468 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
3469 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
3470 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
3471 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
3472 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
3473 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
3474 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
3475 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
3476 MAV_COMP_ID_PATHPLANNER = 195,
3477 #[doc = "Component that plans a collision free path between two points."]
3478 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
3479 #[doc = "Component that provides position estimates using VIO techniques."]
3480 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
3481 #[doc = "Component that manages pairing of vehicle and GCS."]
3482 MAV_COMP_ID_PAIRING_MANAGER = 198,
3483 #[doc = "Inertial Measurement Unit (IMU) #1."]
3484 MAV_COMP_ID_IMU = 200,
3485 #[doc = "Inertial Measurement Unit (IMU) #2."]
3486 MAV_COMP_ID_IMU_2 = 201,
3487 #[doc = "Inertial Measurement Unit (IMU) #3."]
3488 MAV_COMP_ID_IMU_3 = 202,
3489 #[doc = "GPS #1."]
3490 MAV_COMP_ID_GPS = 220,
3491 #[doc = "GPS #2."]
3492 MAV_COMP_ID_GPS2 = 221,
3493 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
3494 MAV_COMP_ID_ODID_TXRX_1 = 236,
3495 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
3496 MAV_COMP_ID_ODID_TXRX_2 = 237,
3497 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
3498 MAV_COMP_ID_ODID_TXRX_3 = 238,
3499 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
3500 MAV_COMP_ID_UDP_BRIDGE = 240,
3501 #[doc = "Component to bridge to UART (i.e. from UDP)."]
3502 MAV_COMP_ID_UART_BRIDGE = 241,
3503 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
3504 MAV_COMP_ID_TUNNEL_NODE = 242,
3505 #[doc = "Illuminator"]
3506 MAV_COMP_ID_ILLUMINATOR = 243,
3507 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
3508 MAV_COMP_ID_SYSTEM_CONTROL = 250,
3509}
3510impl MavComponent {
3511 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
3512}
3513impl Default for MavComponent {
3514 fn default() -> Self {
3515 Self::DEFAULT
3516 }
3517}
3518#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3519#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3520#[cfg_attr(feature = "serde", serde(tag = "type"))]
3521#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3522#[repr(u32)]
3523#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3524pub enum MotorTestOrder {
3525 #[doc = "Default autopilot motor test method."]
3526 MOTOR_TEST_ORDER_DEFAULT = 0,
3527 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3528 MOTOR_TEST_ORDER_SEQUENCE = 1,
3529 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3530 MOTOR_TEST_ORDER_BOARD = 2,
3531}
3532impl MotorTestOrder {
3533 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3534}
3535impl Default for MotorTestOrder {
3536 fn default() -> Self {
3537 Self::DEFAULT
3538 }
3539}
3540#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3541#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3542#[cfg_attr(feature = "serde", serde(tag = "type"))]
3543#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3544#[repr(u32)]
3545#[doc = "Enumeration of landed detector states"]
3546pub enum MavLandedState {
3547 #[doc = "MAV landed state is unknown"]
3548 MAV_LANDED_STATE_UNDEFINED = 0,
3549 #[doc = "MAV is landed (on ground)"]
3550 MAV_LANDED_STATE_ON_GROUND = 1,
3551 #[doc = "MAV is in air"]
3552 MAV_LANDED_STATE_IN_AIR = 2,
3553 #[doc = "MAV currently taking off"]
3554 MAV_LANDED_STATE_TAKEOFF = 3,
3555 #[doc = "MAV currently landing"]
3556 MAV_LANDED_STATE_LANDING = 4,
3557}
3558impl MavLandedState {
3559 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
3560}
3561impl Default for MavLandedState {
3562 fn default() -> Self {
3563 Self::DEFAULT
3564 }
3565}
3566#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3567#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3568#[cfg_attr(feature = "serde", serde(tag = "type"))]
3569#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3570#[repr(u32)]
3571#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3572pub enum PreflightStorageMissionAction {
3573 #[doc = "Read current mission data from persistent storage"]
3574 MISSION_READ_PERSISTENT = 0,
3575 #[doc = "Write current mission data to persistent storage"]
3576 MISSION_WRITE_PERSISTENT = 1,
3577 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
3578 MISSION_RESET_DEFAULT = 2,
3579}
3580impl PreflightStorageMissionAction {
3581 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
3582}
3583impl Default for PreflightStorageMissionAction {
3584 fn default() -> Self {
3585 Self::DEFAULT
3586 }
3587}
3588#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3589#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3590#[cfg_attr(feature = "serde", serde(tag = "type"))]
3591#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3592#[repr(u32)]
3593#[doc = "Video stream encodings"]
3594pub enum VideoStreamEncoding {
3595 #[doc = "Stream encoding is unknown"]
3596 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
3597 #[doc = "Stream encoding is H.264"]
3598 VIDEO_STREAM_ENCODING_H264 = 1,
3599 #[doc = "Stream encoding is H.265"]
3600 VIDEO_STREAM_ENCODING_H265 = 2,
3601}
3602impl VideoStreamEncoding {
3603 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
3604}
3605impl Default for VideoStreamEncoding {
3606 fn default() -> Self {
3607 Self::DEFAULT
3608 }
3609}
3610#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3611#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3612#[cfg_attr(feature = "serde", serde(tag = "type"))]
3613#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3614#[repr(u32)]
3615#[doc = "Enumeration of VTOL states"]
3616pub enum MavVtolState {
3617 #[doc = "MAV is not configured as VTOL"]
3618 MAV_VTOL_STATE_UNDEFINED = 0,
3619 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3620 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3621 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3622 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3623 #[doc = "VTOL is in multicopter state"]
3624 MAV_VTOL_STATE_MC = 3,
3625 #[doc = "VTOL is in fixed-wing state"]
3626 MAV_VTOL_STATE_FW = 4,
3627}
3628impl MavVtolState {
3629 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3630}
3631impl Default for MavVtolState {
3632 fn default() -> Self {
3633 Self::DEFAULT
3634 }
3635}
3636#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3637#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3638#[cfg_attr(feature = "serde", serde(tag = "type"))]
3639#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3640#[repr(u32)]
3641#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
3642pub enum MavAutopilot {
3643 #[doc = "Generic autopilot, full support for everything"]
3644 MAV_AUTOPILOT_GENERIC = 0,
3645 #[doc = "Reserved for future use."]
3646 MAV_AUTOPILOT_RESERVED = 1,
3647 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
3648 MAV_AUTOPILOT_SLUGS = 2,
3649 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
3650 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
3651 #[doc = "OpenPilot, <http://openpilot.org>"]
3652 MAV_AUTOPILOT_OPENPILOT = 4,
3653 #[doc = "Generic autopilot only supporting simple waypoints"]
3654 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
3655 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
3656 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
3657 #[doc = "Generic autopilot supporting the full mission command set"]
3658 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
3659 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
3660 MAV_AUTOPILOT_INVALID = 8,
3661 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
3662 MAV_AUTOPILOT_PPZ = 9,
3663 #[doc = "UAV Dev Board"]
3664 MAV_AUTOPILOT_UDB = 10,
3665 #[doc = "FlexiPilot"]
3666 MAV_AUTOPILOT_FP = 11,
3667 #[doc = "PX4 Autopilot - <http://px4.io/>"]
3668 MAV_AUTOPILOT_PX4 = 12,
3669 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
3670 MAV_AUTOPILOT_SMACCMPILOT = 13,
3671 #[doc = "AutoQuad -- <http://autoquad.org>"]
3672 MAV_AUTOPILOT_AUTOQUAD = 14,
3673 #[doc = "Armazila -- <http://armazila.com>"]
3674 MAV_AUTOPILOT_ARMAZILA = 15,
3675 #[doc = "Aerob -- <http://aerob.ru>"]
3676 MAV_AUTOPILOT_AEROB = 16,
3677 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
3678 MAV_AUTOPILOT_ASLUAV = 17,
3679 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
3680 MAV_AUTOPILOT_SMARTAP = 18,
3681 #[doc = "AirRails - <http://uaventure.com>"]
3682 MAV_AUTOPILOT_AIRRAILS = 19,
3683 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
3684 MAV_AUTOPILOT_REFLEX = 20,
3685}
3686impl MavAutopilot {
3687 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
3688}
3689impl Default for MavAutopilot {
3690 fn default() -> Self {
3691 Self::DEFAULT
3692 }
3693}
3694#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3695#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3696#[cfg_attr(feature = "serde", serde(tag = "type"))]
3697#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3698#[repr(u32)]
3699#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
3700pub enum ActuatorOutputFunction {
3701 #[doc = "No function (disabled)."]
3702 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
3703 #[doc = "Motor 1"]
3704 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
3705 #[doc = "Motor 2"]
3706 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
3707 #[doc = "Motor 3"]
3708 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
3709 #[doc = "Motor 4"]
3710 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
3711 #[doc = "Motor 5"]
3712 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
3713 #[doc = "Motor 6"]
3714 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
3715 #[doc = "Motor 7"]
3716 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
3717 #[doc = "Motor 8"]
3718 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
3719 #[doc = "Motor 9"]
3720 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
3721 #[doc = "Motor 10"]
3722 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
3723 #[doc = "Motor 11"]
3724 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
3725 #[doc = "Motor 12"]
3726 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
3727 #[doc = "Motor 13"]
3728 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
3729 #[doc = "Motor 14"]
3730 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
3731 #[doc = "Motor 15"]
3732 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
3733 #[doc = "Motor 16"]
3734 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
3735 #[doc = "Servo 1"]
3736 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
3737 #[doc = "Servo 2"]
3738 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
3739 #[doc = "Servo 3"]
3740 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
3741 #[doc = "Servo 4"]
3742 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
3743 #[doc = "Servo 5"]
3744 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
3745 #[doc = "Servo 6"]
3746 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
3747 #[doc = "Servo 7"]
3748 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
3749 #[doc = "Servo 8"]
3750 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
3751 #[doc = "Servo 9"]
3752 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
3753 #[doc = "Servo 10"]
3754 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
3755 #[doc = "Servo 11"]
3756 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
3757 #[doc = "Servo 12"]
3758 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
3759 #[doc = "Servo 13"]
3760 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
3761 #[doc = "Servo 14"]
3762 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
3763 #[doc = "Servo 15"]
3764 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
3765 #[doc = "Servo 16"]
3766 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
3767}
3768impl ActuatorOutputFunction {
3769 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
3770}
3771impl Default for ActuatorOutputFunction {
3772 fn default() -> Self {
3773 Self::DEFAULT
3774 }
3775}
3776#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3777#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3778#[cfg_attr(feature = "serde", serde(tag = "type"))]
3779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3780#[repr(u32)]
3781#[doc = "Enumeration of distance sensor types"]
3782pub enum MavDistanceSensor {
3783 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
3784 MAV_DISTANCE_SENSOR_LASER = 0,
3785 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
3786 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
3787 #[doc = "Infrared rangefinder, e.g. Sharp units"]
3788 MAV_DISTANCE_SENSOR_INFRARED = 2,
3789 #[doc = "Radar type, e.g. uLanding units"]
3790 MAV_DISTANCE_SENSOR_RADAR = 3,
3791 #[doc = "Broken or unknown type, e.g. analog units"]
3792 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
3793}
3794impl MavDistanceSensor {
3795 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
3796}
3797impl Default for MavDistanceSensor {
3798 fn default() -> Self {
3799 Self::DEFAULT
3800 }
3801}
3802#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3803#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3804#[cfg_attr(feature = "serde", serde(tag = "type"))]
3805#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3806#[repr(u32)]
3807#[doc = "These flags encode the cellular network status"]
3808pub enum CellularStatusFlag {
3809 #[doc = "State unknown or not reportable."]
3810 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
3811 #[doc = "Modem is unusable"]
3812 CELLULAR_STATUS_FLAG_FAILED = 1,
3813 #[doc = "Modem is being initialized"]
3814 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
3815 #[doc = "Modem is locked"]
3816 CELLULAR_STATUS_FLAG_LOCKED = 3,
3817 #[doc = "Modem is not enabled and is powered down"]
3818 CELLULAR_STATUS_FLAG_DISABLED = 4,
3819 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
3820 CELLULAR_STATUS_FLAG_DISABLING = 5,
3821 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
3822 CELLULAR_STATUS_FLAG_ENABLING = 6,
3823 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
3824 CELLULAR_STATUS_FLAG_ENABLED = 7,
3825 #[doc = "Modem is searching for a network provider to register"]
3826 CELLULAR_STATUS_FLAG_SEARCHING = 8,
3827 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
3828 CELLULAR_STATUS_FLAG_REGISTERED = 9,
3829 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
3830 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
3831 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
3832 CELLULAR_STATUS_FLAG_CONNECTING = 11,
3833 #[doc = "One or more packet data bearers is active and connected"]
3834 CELLULAR_STATUS_FLAG_CONNECTED = 12,
3835}
3836impl CellularStatusFlag {
3837 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
3838}
3839impl Default for CellularStatusFlag {
3840 fn default() -> Self {
3841 Self::DEFAULT
3842 }
3843}
3844#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3845#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3846#[cfg_attr(feature = "serde", serde(tag = "type"))]
3847#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3848#[repr(u32)]
3849pub enum MavTunnelPayloadType {
3850 #[doc = "Encoding of payload unknown."]
3851 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3852 #[doc = "Registered for STorM32 gimbal controller."]
3853 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3854 #[doc = "Registered for STorM32 gimbal controller."]
3855 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3856 #[doc = "Registered for STorM32 gimbal controller."]
3857 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3858 #[doc = "Registered for STorM32 gimbal controller."]
3859 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3860 #[doc = "Registered for STorM32 gimbal controller."]
3861 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3862 #[doc = "Registered for STorM32 gimbal controller."]
3863 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3864 #[doc = "Registered for STorM32 gimbal controller."]
3865 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3866 #[doc = "Registered for STorM32 gimbal controller."]
3867 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3868 #[doc = "Registered for STorM32 gimbal controller."]
3869 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3870 #[doc = "Registered for STorM32 gimbal controller."]
3871 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3872 #[doc = "Registered for ModalAI remote OSD protocol."]
3873 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3874 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3875 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3876 #[doc = "Registered for ModalAI vendor use."]
3877 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3878}
3879impl MavTunnelPayloadType {
3880 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3881}
3882impl Default for MavTunnelPayloadType {
3883 fn default() -> Self {
3884 Self::DEFAULT
3885 }
3886}
3887bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
3888impl HilActuatorControlsFlags {
3889 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
3890}
3891impl Default for HilActuatorControlsFlags {
3892 fn default() -> Self {
3893 Self::DEFAULT
3894 }
3895}
3896#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3897#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3898#[cfg_attr(feature = "serde", serde(tag = "type"))]
3899#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3900#[repr(u32)]
3901#[doc = "Enumeration of the ADSB altimeter types"]
3902pub enum AdsbAltitudeType {
3903 #[doc = "Altitude reported from a Baro source using QNH reference"]
3904 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
3905 #[doc = "Altitude reported from a GNSS source"]
3906 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
3907}
3908impl AdsbAltitudeType {
3909 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
3910}
3911impl Default for AdsbAltitudeType {
3912 fn default() -> Self {
3913 Self::DEFAULT
3914 }
3915}
3916#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3917#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3918#[cfg_attr(feature = "serde", serde(tag = "type"))]
3919#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3920#[repr(u32)]
3921#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
3922pub enum MavEventCurrentSequenceFlags {
3923 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
3924 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
3925}
3926impl MavEventCurrentSequenceFlags {
3927 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
3928}
3929impl Default for MavEventCurrentSequenceFlags {
3930 fn default() -> Self {
3931 Self::DEFAULT
3932 }
3933}
3934#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3935#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3936#[cfg_attr(feature = "serde", serde(tag = "type"))]
3937#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3938#[repr(u32)]
3939#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
3940pub enum CameraSource {
3941 #[doc = "Default camera source."]
3942 CAMERA_SOURCE_DEFAULT = 0,
3943 #[doc = "RGB camera source."]
3944 CAMERA_SOURCE_RGB = 1,
3945 #[doc = "IR camera source."]
3946 CAMERA_SOURCE_IR = 2,
3947 #[doc = "NDVI camera source."]
3948 CAMERA_SOURCE_NDVI = 3,
3949}
3950impl CameraSource {
3951 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
3952}
3953impl Default for CameraSource {
3954 fn default() -> Self {
3955 Self::DEFAULT
3956 }
3957}
3958#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3959#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3960#[cfg_attr(feature = "serde", serde(tag = "type"))]
3961#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3962#[repr(u32)]
3963#[doc = "Camera tracking modes"]
3964pub enum CameraTrackingMode {
3965 #[doc = "Not tracking"]
3966 CAMERA_TRACKING_MODE_NONE = 0,
3967 #[doc = "Target is a point"]
3968 CAMERA_TRACKING_MODE_POINT = 1,
3969 #[doc = "Target is a rectangle"]
3970 CAMERA_TRACKING_MODE_RECTANGLE = 2,
3971}
3972impl CameraTrackingMode {
3973 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
3974}
3975impl Default for CameraTrackingMode {
3976 fn default() -> Self {
3977 Self::DEFAULT
3978 }
3979}
3980#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3981#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3982#[cfg_attr(feature = "serde", serde(tag = "type"))]
3983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3984#[repr(u32)]
3985pub enum MavOdidVerAcc {
3986 #[doc = "The vertical accuracy is unknown."]
3987 MAV_ODID_VER_ACC_UNKNOWN = 0,
3988 #[doc = "The vertical accuracy is smaller than 150 meter."]
3989 MAV_ODID_VER_ACC_150_METER = 1,
3990 #[doc = "The vertical accuracy is smaller than 45 meter."]
3991 MAV_ODID_VER_ACC_45_METER = 2,
3992 #[doc = "The vertical accuracy is smaller than 25 meter."]
3993 MAV_ODID_VER_ACC_25_METER = 3,
3994 #[doc = "The vertical accuracy is smaller than 10 meter."]
3995 MAV_ODID_VER_ACC_10_METER = 4,
3996 #[doc = "The vertical accuracy is smaller than 3 meter."]
3997 MAV_ODID_VER_ACC_3_METER = 5,
3998 #[doc = "The vertical accuracy is smaller than 1 meter."]
3999 MAV_ODID_VER_ACC_1_METER = 6,
4000}
4001impl MavOdidVerAcc {
4002 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
4003}
4004impl Default for MavOdidVerAcc {
4005 fn default() -> Self {
4006 Self::DEFAULT
4007 }
4008}
4009#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4010#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4011#[cfg_attr(feature = "serde", serde(tag = "type"))]
4012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4013#[repr(u32)]
4014#[doc = "Enumeration of estimator types"]
4015pub enum MavEstimatorType {
4016 #[doc = "Unknown type of the estimator."]
4017 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
4018 #[doc = "This is a naive estimator without any real covariance feedback."]
4019 MAV_ESTIMATOR_TYPE_NAIVE = 1,
4020 #[doc = "Computer vision based estimate. Might be up to scale."]
4021 MAV_ESTIMATOR_TYPE_VISION = 2,
4022 #[doc = "Visual-inertial estimate."]
4023 MAV_ESTIMATOR_TYPE_VIO = 3,
4024 #[doc = "Plain GPS estimate."]
4025 MAV_ESTIMATOR_TYPE_GPS = 4,
4026 #[doc = "Estimator integrating GPS and inertial sensing."]
4027 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
4028 #[doc = "Estimate from external motion capturing system."]
4029 MAV_ESTIMATOR_TYPE_MOCAP = 6,
4030 #[doc = "Estimator based on lidar sensor input."]
4031 MAV_ESTIMATOR_TYPE_LIDAR = 7,
4032 #[doc = "Estimator on autopilot."]
4033 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
4034}
4035impl MavEstimatorType {
4036 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
4037}
4038impl Default for MavEstimatorType {
4039 fn default() -> Self {
4040 Self::DEFAULT
4041 }
4042}
4043#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4044#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4045#[cfg_attr(feature = "serde", serde(tag = "type"))]
4046#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4047#[repr(u32)]
4048#[doc = "List of possible failure type to inject."]
4049pub enum FailureType {
4050 #[doc = "No failure injected, used to reset a previous failure."]
4051 FAILURE_TYPE_OK = 0,
4052 #[doc = "Sets unit off, so completely non-responsive."]
4053 FAILURE_TYPE_OFF = 1,
4054 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
4055 FAILURE_TYPE_STUCK = 2,
4056 #[doc = "Unit is reporting complete garbage."]
4057 FAILURE_TYPE_GARBAGE = 3,
4058 #[doc = "Unit is consistently wrong."]
4059 FAILURE_TYPE_WRONG = 4,
4060 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
4061 FAILURE_TYPE_SLOW = 5,
4062 #[doc = "Data of unit is delayed in time."]
4063 FAILURE_TYPE_DELAYED = 6,
4064 #[doc = "Unit is sometimes working, sometimes not."]
4065 FAILURE_TYPE_INTERMITTENT = 7,
4066}
4067impl FailureType {
4068 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
4069}
4070impl Default for FailureType {
4071 fn default() -> Self {
4072 Self::DEFAULT
4073 }
4074}
4075#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4076#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4077#[cfg_attr(feature = "serde", serde(tag = "type"))]
4078#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4079#[repr(u32)]
4080#[doc = "Modes of illuminator"]
4081pub enum IlluminatorMode {
4082 #[doc = "Illuminator mode is not specified/unknown"]
4083 ILLUMINATOR_MODE_UNKNOWN = 0,
4084 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
4085 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
4086 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
4087 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
4088}
4089impl IlluminatorMode {
4090 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
4091}
4092impl Default for IlluminatorMode {
4093 fn default() -> Self {
4094 Self::DEFAULT
4095 }
4096}
4097bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
4098impl MavWinchStatusFlag {
4099 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
4100}
4101impl Default for MavWinchStatusFlag {
4102 fn default() -> Self {
4103 Self::DEFAULT
4104 }
4105}
4106bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
4107impl AisFlags {
4108 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
4109}
4110impl Default for AisFlags {
4111 fn default() -> Self {
4112 Self::DEFAULT
4113 }
4114}
4115#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4116#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4117#[cfg_attr(feature = "serde", serde(tag = "type"))]
4118#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4119#[repr(u32)]
4120#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4121pub enum TuneFormat {
4122 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4123 TUNE_FORMAT_QBASIC1_1 = 1,
4124 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4125 TUNE_FORMAT_MML_MODERN = 2,
4126}
4127impl TuneFormat {
4128 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4129}
4130impl Default for TuneFormat {
4131 fn default() -> Self {
4132 Self::DEFAULT
4133 }
4134}
4135#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4136#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4137#[cfg_attr(feature = "serde", serde(tag = "type"))]
4138#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4139#[repr(u32)]
4140#[doc = "Enumeration of battery types"]
4141pub enum MavBatteryType {
4142 #[doc = "Not specified."]
4143 MAV_BATTERY_TYPE_UNKNOWN = 0,
4144 #[doc = "Lithium polymer battery"]
4145 MAV_BATTERY_TYPE_LIPO = 1,
4146 #[doc = "Lithium-iron-phosphate battery"]
4147 MAV_BATTERY_TYPE_LIFE = 2,
4148 #[doc = "Lithium-ION battery"]
4149 MAV_BATTERY_TYPE_LION = 3,
4150 #[doc = "Nickel metal hydride battery"]
4151 MAV_BATTERY_TYPE_NIMH = 4,
4152}
4153impl MavBatteryType {
4154 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
4155}
4156impl Default for MavBatteryType {
4157 fn default() -> Self {
4158 Self::DEFAULT
4159 }
4160}
4161#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4162#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4163#[cfg_attr(feature = "serde", serde(tag = "type"))]
4164#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4165#[repr(u32)]
4166#[doc = "Enumeration for battery charge states."]
4167pub enum MavBatteryChargeState {
4168 #[doc = "Low battery state is not provided"]
4169 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
4170 #[doc = "Battery is not in low state. Normal operation."]
4171 MAV_BATTERY_CHARGE_STATE_OK = 1,
4172 #[doc = "Battery state is low, warn and monitor close."]
4173 MAV_BATTERY_CHARGE_STATE_LOW = 2,
4174 #[doc = "Battery state is critical, return or abort immediately."]
4175 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
4176 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
4177 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
4178 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
4179 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
4180 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
4181 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
4182 #[doc = "Battery is charging."]
4183 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
4184}
4185impl MavBatteryChargeState {
4186 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
4187}
4188impl Default for MavBatteryChargeState {
4189 fn default() -> Self {
4190 Self::DEFAULT
4191 }
4192}
4193#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4194#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4195#[cfg_attr(feature = "serde", serde(tag = "type"))]
4196#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4197#[repr(u32)]
4198#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
4199pub enum MavMountMode {
4200 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
4201 MAV_MOUNT_MODE_RETRACT = 0,
4202 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
4203 MAV_MOUNT_MODE_NEUTRAL = 1,
4204 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
4205 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
4206 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
4207 MAV_MOUNT_MODE_RC_TARGETING = 3,
4208 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
4209 MAV_MOUNT_MODE_GPS_POINT = 4,
4210 #[doc = "Gimbal tracks system with specified system ID"]
4211 MAV_MOUNT_MODE_SYSID_TARGET = 5,
4212 #[doc = "Gimbal tracks home position"]
4213 MAV_MOUNT_MODE_HOME_LOCATION = 6,
4214}
4215impl MavMountMode {
4216 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
4217}
4218impl Default for MavMountMode {
4219 fn default() -> Self {
4220 Self::DEFAULT
4221 }
4222}
4223bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
4224impl GpsInputIgnoreFlags {
4225 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
4226}
4227impl Default for GpsInputIgnoreFlags {
4228 fn default() -> Self {
4229 Self::DEFAULT
4230 }
4231}
4232#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4233#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4234#[cfg_attr(feature = "serde", serde(tag = "type"))]
4235#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4236#[repr(u32)]
4237#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
4238pub enum MavFtpOpcode {
4239 #[doc = "None. Ignored, always ACKed"]
4240 MAV_FTP_OPCODE_NONE = 0,
4241 #[doc = "TerminateSession: Terminates open Read session"]
4242 MAV_FTP_OPCODE_TERMINATESESSION = 1,
4243 #[doc = "ResetSessions: Terminates all open read sessions"]
4244 MAV_FTP_OPCODE_RESETSESSION = 2,
4245 #[doc = "ListDirectory. List files and directories in path from offset"]
4246 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
4247 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
4248 MAV_FTP_OPCODE_OPENFILERO = 4,
4249 #[doc = "ReadFile: Reads size bytes from offset in session"]
4250 MAV_FTP_OPCODE_READFILE = 5,
4251 #[doc = "CreateFile: Creates file at path for writing, returns session"]
4252 MAV_FTP_OPCODE_CREATEFILE = 6,
4253 #[doc = "WriteFile: Writes size bytes to offset in session"]
4254 MAV_FTP_OPCODE_WRITEFILE = 7,
4255 #[doc = "RemoveFile: Remove file at path"]
4256 MAV_FTP_OPCODE_REMOVEFILE = 8,
4257 #[doc = "CreateDirectory: Creates directory at path"]
4258 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
4259 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
4260 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
4261 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
4262 MAV_FTP_OPCODE_OPENFILEWO = 11,
4263 #[doc = "TruncateFile: Truncate file at path to offset length"]
4264 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
4265 #[doc = "Rename: Rename path1 to path2"]
4266 MAV_FTP_OPCODE_RENAME = 13,
4267 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
4268 MAV_FTP_OPCODE_CALCFILECRC = 14,
4269 #[doc = "BurstReadFile: Burst download session file"]
4270 MAV_FTP_OPCODE_BURSTREADFILE = 15,
4271 #[doc = "ACK: ACK response"]
4272 MAV_FTP_OPCODE_ACK = 128,
4273 #[doc = "NAK: NAK response"]
4274 MAV_FTP_OPCODE_NAK = 129,
4275}
4276impl MavFtpOpcode {
4277 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
4278}
4279impl Default for MavFtpOpcode {
4280 fn default() -> Self {
4281 Self::DEFAULT
4282 }
4283}
4284bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
4285impl HlFailureFlag {
4286 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
4287}
4288impl Default for HlFailureFlag {
4289 fn default() -> Self {
4290 Self::DEFAULT
4291 }
4292}
4293bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
4294impl MavProtocolCapability {
4295 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
4296}
4297impl Default for MavProtocolCapability {
4298 fn default() -> Self {
4299 Self::DEFAULT
4300 }
4301}
4302bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4303impl UtmDataAvailFlags {
4304 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4305}
4306impl Default for UtmDataAvailFlags {
4307 fn default() -> Self {
4308 Self::DEFAULT
4309 }
4310}
4311#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4312#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4313#[cfg_attr(feature = "serde", serde(tag = "type"))]
4314#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4315#[repr(u32)]
4316pub enum MavArmAuthDeniedReason {
4317 #[doc = "Not a specific reason"]
4318 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
4319 #[doc = "Authorizer will send the error as string to GCS"]
4320 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
4321 #[doc = "At least one waypoint have a invalid value"]
4322 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
4323 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
4324 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
4325 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
4326 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
4327 #[doc = "Weather is not good to fly"]
4328 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
4329}
4330impl MavArmAuthDeniedReason {
4331 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
4332}
4333impl Default for MavArmAuthDeniedReason {
4334 fn default() -> Self {
4335 Self::DEFAULT
4336 }
4337}
4338#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4339#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4340#[cfg_attr(feature = "serde", serde(tag = "type"))]
4341#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4342#[repr(u32)]
4343#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4344pub enum SetFocusType {
4345 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4346 FOCUS_TYPE_STEP = 0,
4347 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4348 FOCUS_TYPE_CONTINUOUS = 1,
4349 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4350 FOCUS_TYPE_RANGE = 2,
4351 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4352 FOCUS_TYPE_METERS = 3,
4353 #[doc = "Focus automatically."]
4354 FOCUS_TYPE_AUTO = 4,
4355 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4356 FOCUS_TYPE_AUTO_SINGLE = 5,
4357 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4358 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4359}
4360impl SetFocusType {
4361 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4362}
4363impl Default for SetFocusType {
4364 fn default() -> Self {
4365 Self::DEFAULT
4366 }
4367}
4368#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4369#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4370#[cfg_attr(feature = "serde", serde(tag = "type"))]
4371#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4372#[repr(u32)]
4373#[doc = "Possible responses from a CELLULAR_CONFIG message."]
4374pub enum CellularConfigResponse {
4375 #[doc = "Changes accepted."]
4376 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
4377 #[doc = "Invalid APN."]
4378 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
4379 #[doc = "Invalid PIN."]
4380 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
4381 #[doc = "Changes rejected."]
4382 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
4383 #[doc = "PUK is required to unblock SIM card."]
4384 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
4385}
4386impl CellularConfigResponse {
4387 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
4388}
4389impl Default for CellularConfigResponse {
4390 fn default() -> Self {
4391 Self::DEFAULT
4392 }
4393}
4394#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4395#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4396#[cfg_attr(feature = "serde", serde(tag = "type"))]
4397#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4398#[repr(u32)]
4399#[doc = "Source of information about this collision."]
4400pub enum MavCollisionSrc {
4401 #[doc = "ID field references ADSB_VEHICLE packets"]
4402 MAV_COLLISION_SRC_ADSB = 0,
4403 #[doc = "ID field references MAVLink SRC ID"]
4404 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
4405}
4406impl MavCollisionSrc {
4407 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
4408}
4409impl Default for MavCollisionSrc {
4410 fn default() -> Self {
4411 Self::DEFAULT
4412 }
4413}
4414#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4415#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4416#[cfg_attr(feature = "serde", serde(tag = "type"))]
4417#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4418#[repr(u32)]
4419#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
4420pub enum PreflightStorageParameterAction {
4421 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
4422 PARAM_READ_PERSISTENT = 0,
4423 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
4424 PARAM_WRITE_PERSISTENT = 1,
4425 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
4426 PARAM_RESET_CONFIG_DEFAULT = 2,
4427 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
4428 PARAM_RESET_SENSOR_DEFAULT = 3,
4429 #[doc = "Reset all parameters, including operation counters, to default values"]
4430 PARAM_RESET_ALL_DEFAULT = 4,
4431}
4432impl PreflightStorageParameterAction {
4433 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
4434}
4435impl Default for PreflightStorageParameterAction {
4436 fn default() -> Self {
4437 Self::DEFAULT
4438 }
4439}
4440#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4441#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4442#[cfg_attr(feature = "serde", serde(tag = "type"))]
4443#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4444#[repr(u32)]
4445pub enum MavlinkDataStreamType {
4446 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
4447 MAVLINK_DATA_STREAM_IMG_BMP = 1,
4448 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
4449 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
4450 MAVLINK_DATA_STREAM_IMG_PGM = 4,
4451 MAVLINK_DATA_STREAM_IMG_PNG = 5,
4452}
4453impl MavlinkDataStreamType {
4454 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
4455}
4456impl Default for MavlinkDataStreamType {
4457 fn default() -> Self {
4458 Self::DEFAULT
4459 }
4460}
4461#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4462#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4463#[cfg_attr(feature = "serde", serde(tag = "type"))]
4464#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4465#[repr(u32)]
4466#[doc = "Flags to indicate the status of camera storage."]
4467pub enum StorageStatus {
4468 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4469 STORAGE_STATUS_EMPTY = 0,
4470 #[doc = "Storage present but unformatted."]
4471 STORAGE_STATUS_UNFORMATTED = 1,
4472 #[doc = "Storage present and ready."]
4473 STORAGE_STATUS_READY = 2,
4474 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4475 STORAGE_STATUS_NOT_SUPPORTED = 3,
4476}
4477impl StorageStatus {
4478 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4479}
4480impl Default for StorageStatus {
4481 fn default() -> Self {
4482 Self::DEFAULT
4483 }
4484}
4485bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
4486impl MavGeneratorStatusFlag {
4487 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
4488}
4489impl Default for MavGeneratorStatusFlag {
4490 fn default() -> Self {
4491 Self::DEFAULT
4492 }
4493}
4494bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
4495impl AdsbFlags {
4496 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
4497}
4498impl Default for AdsbFlags {
4499 fn default() -> Self {
4500 Self::DEFAULT
4501 }
4502}
4503#[doc = "id: 102"]
4504#[doc = "Local position/attitude estimate from a vision source."]
4505#[derive(Debug, Clone, PartialEq)]
4506#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4507#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4508pub struct VISION_POSITION_ESTIMATE_DATA {
4509 #[doc = "Timestamp (UNIX time or time since system boot)"]
4510 pub usec: u64,
4511 #[doc = "Local X position"]
4512 pub x: f32,
4513 #[doc = "Local Y position"]
4514 pub y: f32,
4515 #[doc = "Local Z position"]
4516 pub z: f32,
4517 #[doc = "Roll angle"]
4518 pub roll: f32,
4519 #[doc = "Pitch angle"]
4520 pub pitch: f32,
4521 #[doc = "Yaw angle"]
4522 pub yaw: f32,
4523 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
4524 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
4525 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4526 pub covariance: [f32; 21],
4527 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
4528 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
4529 pub reset_counter: u8,
4530}
4531impl VISION_POSITION_ESTIMATE_DATA {
4532 pub const ENCODED_LEN: usize = 117usize;
4533 pub const DEFAULT: Self = Self {
4534 usec: 0_u64,
4535 x: 0.0_f32,
4536 y: 0.0_f32,
4537 z: 0.0_f32,
4538 roll: 0.0_f32,
4539 pitch: 0.0_f32,
4540 yaw: 0.0_f32,
4541 covariance: [0.0_f32; 21usize],
4542 reset_counter: 0_u8,
4543 };
4544 #[cfg(feature = "arbitrary")]
4545 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4546 use arbitrary::{Arbitrary, Unstructured};
4547 let mut buf = [0u8; 1024];
4548 rng.fill_bytes(&mut buf);
4549 let mut unstructured = Unstructured::new(&buf);
4550 Self::arbitrary(&mut unstructured).unwrap_or_default()
4551 }
4552}
4553impl Default for VISION_POSITION_ESTIMATE_DATA {
4554 fn default() -> Self {
4555 Self::DEFAULT.clone()
4556 }
4557}
4558impl MessageData for VISION_POSITION_ESTIMATE_DATA {
4559 type Message = MavMessage;
4560 const ID: u32 = 102u32;
4561 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
4562 const EXTRA_CRC: u8 = 158u8;
4563 const ENCODED_LEN: usize = 117usize;
4564 fn deser(
4565 _version: MavlinkVersion,
4566 __input: &[u8],
4567 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4568 let avail_len = __input.len();
4569 let mut payload_buf = [0; Self::ENCODED_LEN];
4570 let mut buf = if avail_len < Self::ENCODED_LEN {
4571 payload_buf[0..avail_len].copy_from_slice(__input);
4572 Bytes::new(&payload_buf)
4573 } else {
4574 Bytes::new(__input)
4575 };
4576 let mut __struct = Self::default();
4577 __struct.usec = buf.get_u64_le();
4578 __struct.x = buf.get_f32_le();
4579 __struct.y = buf.get_f32_le();
4580 __struct.z = buf.get_f32_le();
4581 __struct.roll = buf.get_f32_le();
4582 __struct.pitch = buf.get_f32_le();
4583 __struct.yaw = buf.get_f32_le();
4584 for v in &mut __struct.covariance {
4585 let val = buf.get_f32_le();
4586 *v = val;
4587 }
4588 __struct.reset_counter = buf.get_u8();
4589 Ok(__struct)
4590 }
4591 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4592 let mut __tmp = BytesMut::new(bytes);
4593 #[allow(clippy::absurd_extreme_comparisons)]
4594 #[allow(unused_comparisons)]
4595 if __tmp.remaining() < Self::ENCODED_LEN {
4596 panic!(
4597 "buffer is too small (need {} bytes, but got {})",
4598 Self::ENCODED_LEN,
4599 __tmp.remaining(),
4600 )
4601 }
4602 __tmp.put_u64_le(self.usec);
4603 __tmp.put_f32_le(self.x);
4604 __tmp.put_f32_le(self.y);
4605 __tmp.put_f32_le(self.z);
4606 __tmp.put_f32_le(self.roll);
4607 __tmp.put_f32_le(self.pitch);
4608 __tmp.put_f32_le(self.yaw);
4609 for val in &self.covariance {
4610 __tmp.put_f32_le(*val);
4611 }
4612 __tmp.put_u8(self.reset_counter);
4613 if matches!(version, MavlinkVersion::V2) {
4614 let len = __tmp.len();
4615 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4616 } else {
4617 __tmp.len()
4618 }
4619 }
4620}
4621#[doc = "id: 44"]
4622#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
4623#[derive(Debug, Clone, PartialEq)]
4624#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4625#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4626pub struct MISSION_COUNT_DATA {
4627 #[doc = "Number of mission items in the sequence"]
4628 pub count: u16,
4629 #[doc = "System ID"]
4630 pub target_system: u8,
4631 #[doc = "Component ID"]
4632 pub target_component: u8,
4633 #[doc = "Mission type."]
4634 #[cfg_attr(feature = "serde", serde(default))]
4635 pub mission_type: MavMissionType,
4636 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
4637 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
4638 pub opaque_id: u32,
4639}
4640impl MISSION_COUNT_DATA {
4641 pub const ENCODED_LEN: usize = 9usize;
4642 pub const DEFAULT: Self = Self {
4643 count: 0_u16,
4644 target_system: 0_u8,
4645 target_component: 0_u8,
4646 mission_type: MavMissionType::DEFAULT,
4647 opaque_id: 0_u32,
4648 };
4649 #[cfg(feature = "arbitrary")]
4650 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4651 use arbitrary::{Arbitrary, Unstructured};
4652 let mut buf = [0u8; 1024];
4653 rng.fill_bytes(&mut buf);
4654 let mut unstructured = Unstructured::new(&buf);
4655 Self::arbitrary(&mut unstructured).unwrap_or_default()
4656 }
4657}
4658impl Default for MISSION_COUNT_DATA {
4659 fn default() -> Self {
4660 Self::DEFAULT.clone()
4661 }
4662}
4663impl MessageData for MISSION_COUNT_DATA {
4664 type Message = MavMessage;
4665 const ID: u32 = 44u32;
4666 const NAME: &'static str = "MISSION_COUNT";
4667 const EXTRA_CRC: u8 = 221u8;
4668 const ENCODED_LEN: usize = 9usize;
4669 fn deser(
4670 _version: MavlinkVersion,
4671 __input: &[u8],
4672 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4673 let avail_len = __input.len();
4674 let mut payload_buf = [0; Self::ENCODED_LEN];
4675 let mut buf = if avail_len < Self::ENCODED_LEN {
4676 payload_buf[0..avail_len].copy_from_slice(__input);
4677 Bytes::new(&payload_buf)
4678 } else {
4679 Bytes::new(__input)
4680 };
4681 let mut __struct = Self::default();
4682 __struct.count = buf.get_u16_le();
4683 __struct.target_system = buf.get_u8();
4684 __struct.target_component = buf.get_u8();
4685 let tmp = buf.get_u8();
4686 __struct.mission_type =
4687 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4688 enum_type: "MavMissionType",
4689 value: tmp as u32,
4690 })?;
4691 __struct.opaque_id = buf.get_u32_le();
4692 Ok(__struct)
4693 }
4694 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4695 let mut __tmp = BytesMut::new(bytes);
4696 #[allow(clippy::absurd_extreme_comparisons)]
4697 #[allow(unused_comparisons)]
4698 if __tmp.remaining() < Self::ENCODED_LEN {
4699 panic!(
4700 "buffer is too small (need {} bytes, but got {})",
4701 Self::ENCODED_LEN,
4702 __tmp.remaining(),
4703 )
4704 }
4705 __tmp.put_u16_le(self.count);
4706 __tmp.put_u8(self.target_system);
4707 __tmp.put_u8(self.target_component);
4708 __tmp.put_u8(self.mission_type as u8);
4709 __tmp.put_u32_le(self.opaque_id);
4710 if matches!(version, MavlinkVersion::V2) {
4711 let len = __tmp.len();
4712 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4713 } else {
4714 __tmp.len()
4715 }
4716 }
4717}
4718#[doc = "id: 106"]
4719#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
4720#[derive(Debug, Clone, PartialEq)]
4721#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4722#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4723pub struct OPTICAL_FLOW_RAD_DATA {
4724 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4725 pub time_usec: u64,
4726 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
4727 pub integration_time_us: u32,
4728 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
4729 pub integrated_x: f32,
4730 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
4731 pub integrated_y: f32,
4732 #[doc = "RH rotation around X axis"]
4733 pub integrated_xgyro: f32,
4734 #[doc = "RH rotation around Y axis"]
4735 pub integrated_ygyro: f32,
4736 #[doc = "RH rotation around Z axis"]
4737 pub integrated_zgyro: f32,
4738 #[doc = "Time since the distance was sampled."]
4739 pub time_delta_distance_us: u32,
4740 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
4741 pub distance: f32,
4742 #[doc = "Temperature"]
4743 pub temperature: i16,
4744 #[doc = "Sensor ID"]
4745 pub sensor_id: u8,
4746 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
4747 pub quality: u8,
4748}
4749impl OPTICAL_FLOW_RAD_DATA {
4750 pub const ENCODED_LEN: usize = 44usize;
4751 pub const DEFAULT: Self = Self {
4752 time_usec: 0_u64,
4753 integration_time_us: 0_u32,
4754 integrated_x: 0.0_f32,
4755 integrated_y: 0.0_f32,
4756 integrated_xgyro: 0.0_f32,
4757 integrated_ygyro: 0.0_f32,
4758 integrated_zgyro: 0.0_f32,
4759 time_delta_distance_us: 0_u32,
4760 distance: 0.0_f32,
4761 temperature: 0_i16,
4762 sensor_id: 0_u8,
4763 quality: 0_u8,
4764 };
4765 #[cfg(feature = "arbitrary")]
4766 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4767 use arbitrary::{Arbitrary, Unstructured};
4768 let mut buf = [0u8; 1024];
4769 rng.fill_bytes(&mut buf);
4770 let mut unstructured = Unstructured::new(&buf);
4771 Self::arbitrary(&mut unstructured).unwrap_or_default()
4772 }
4773}
4774impl Default for OPTICAL_FLOW_RAD_DATA {
4775 fn default() -> Self {
4776 Self::DEFAULT.clone()
4777 }
4778}
4779impl MessageData for OPTICAL_FLOW_RAD_DATA {
4780 type Message = MavMessage;
4781 const ID: u32 = 106u32;
4782 const NAME: &'static str = "OPTICAL_FLOW_RAD";
4783 const EXTRA_CRC: u8 = 138u8;
4784 const ENCODED_LEN: usize = 44usize;
4785 fn deser(
4786 _version: MavlinkVersion,
4787 __input: &[u8],
4788 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4789 let avail_len = __input.len();
4790 let mut payload_buf = [0; Self::ENCODED_LEN];
4791 let mut buf = if avail_len < Self::ENCODED_LEN {
4792 payload_buf[0..avail_len].copy_from_slice(__input);
4793 Bytes::new(&payload_buf)
4794 } else {
4795 Bytes::new(__input)
4796 };
4797 let mut __struct = Self::default();
4798 __struct.time_usec = buf.get_u64_le();
4799 __struct.integration_time_us = buf.get_u32_le();
4800 __struct.integrated_x = buf.get_f32_le();
4801 __struct.integrated_y = buf.get_f32_le();
4802 __struct.integrated_xgyro = buf.get_f32_le();
4803 __struct.integrated_ygyro = buf.get_f32_le();
4804 __struct.integrated_zgyro = buf.get_f32_le();
4805 __struct.time_delta_distance_us = buf.get_u32_le();
4806 __struct.distance = buf.get_f32_le();
4807 __struct.temperature = buf.get_i16_le();
4808 __struct.sensor_id = buf.get_u8();
4809 __struct.quality = buf.get_u8();
4810 Ok(__struct)
4811 }
4812 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4813 let mut __tmp = BytesMut::new(bytes);
4814 #[allow(clippy::absurd_extreme_comparisons)]
4815 #[allow(unused_comparisons)]
4816 if __tmp.remaining() < Self::ENCODED_LEN {
4817 panic!(
4818 "buffer is too small (need {} bytes, but got {})",
4819 Self::ENCODED_LEN,
4820 __tmp.remaining(),
4821 )
4822 }
4823 __tmp.put_u64_le(self.time_usec);
4824 __tmp.put_u32_le(self.integration_time_us);
4825 __tmp.put_f32_le(self.integrated_x);
4826 __tmp.put_f32_le(self.integrated_y);
4827 __tmp.put_f32_le(self.integrated_xgyro);
4828 __tmp.put_f32_le(self.integrated_ygyro);
4829 __tmp.put_f32_le(self.integrated_zgyro);
4830 __tmp.put_u32_le(self.time_delta_distance_us);
4831 __tmp.put_f32_le(self.distance);
4832 __tmp.put_i16_le(self.temperature);
4833 __tmp.put_u8(self.sensor_id);
4834 __tmp.put_u8(self.quality);
4835 if matches!(version, MavlinkVersion::V2) {
4836 let len = __tmp.len();
4837 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4838 } else {
4839 __tmp.len()
4840 }
4841 }
4842}
4843#[doc = "id: 139"]
4844#[doc = "Set the vehicle attitude and body angular rates."]
4845#[derive(Debug, Clone, PartialEq)]
4846#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4847#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4848pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
4849 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4850 pub time_usec: u64,
4851 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4852 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4853 pub controls: [f32; 8],
4854 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4855 pub group_mlx: u8,
4856 #[doc = "System ID"]
4857 pub target_system: u8,
4858 #[doc = "Component ID"]
4859 pub target_component: u8,
4860}
4861impl SET_ACTUATOR_CONTROL_TARGET_DATA {
4862 pub const ENCODED_LEN: usize = 43usize;
4863 pub const DEFAULT: Self = Self {
4864 time_usec: 0_u64,
4865 controls: [0.0_f32; 8usize],
4866 group_mlx: 0_u8,
4867 target_system: 0_u8,
4868 target_component: 0_u8,
4869 };
4870 #[cfg(feature = "arbitrary")]
4871 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4872 use arbitrary::{Arbitrary, Unstructured};
4873 let mut buf = [0u8; 1024];
4874 rng.fill_bytes(&mut buf);
4875 let mut unstructured = Unstructured::new(&buf);
4876 Self::arbitrary(&mut unstructured).unwrap_or_default()
4877 }
4878}
4879impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
4880 fn default() -> Self {
4881 Self::DEFAULT.clone()
4882 }
4883}
4884impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
4885 type Message = MavMessage;
4886 const ID: u32 = 139u32;
4887 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
4888 const EXTRA_CRC: u8 = 168u8;
4889 const ENCODED_LEN: usize = 43usize;
4890 fn deser(
4891 _version: MavlinkVersion,
4892 __input: &[u8],
4893 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4894 let avail_len = __input.len();
4895 let mut payload_buf = [0; Self::ENCODED_LEN];
4896 let mut buf = if avail_len < Self::ENCODED_LEN {
4897 payload_buf[0..avail_len].copy_from_slice(__input);
4898 Bytes::new(&payload_buf)
4899 } else {
4900 Bytes::new(__input)
4901 };
4902 let mut __struct = Self::default();
4903 __struct.time_usec = buf.get_u64_le();
4904 for v in &mut __struct.controls {
4905 let val = buf.get_f32_le();
4906 *v = val;
4907 }
4908 __struct.group_mlx = buf.get_u8();
4909 __struct.target_system = buf.get_u8();
4910 __struct.target_component = buf.get_u8();
4911 Ok(__struct)
4912 }
4913 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4914 let mut __tmp = BytesMut::new(bytes);
4915 #[allow(clippy::absurd_extreme_comparisons)]
4916 #[allow(unused_comparisons)]
4917 if __tmp.remaining() < Self::ENCODED_LEN {
4918 panic!(
4919 "buffer is too small (need {} bytes, but got {})",
4920 Self::ENCODED_LEN,
4921 __tmp.remaining(),
4922 )
4923 }
4924 __tmp.put_u64_le(self.time_usec);
4925 for val in &self.controls {
4926 __tmp.put_f32_le(*val);
4927 }
4928 __tmp.put_u8(self.group_mlx);
4929 __tmp.put_u8(self.target_system);
4930 __tmp.put_u8(self.target_component);
4931 if matches!(version, MavlinkVersion::V2) {
4932 let len = __tmp.len();
4933 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4934 } else {
4935 __tmp.len()
4936 }
4937 }
4938}
4939#[doc = "id: 311"]
4940#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
4941#[derive(Debug, Clone, PartialEq)]
4942#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4943#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4944pub struct UAVCAN_NODE_INFO_DATA {
4945 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4946 pub time_usec: u64,
4947 #[doc = "Time since the start-up of the node."]
4948 pub uptime_sec: u32,
4949 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
4950 pub sw_vcs_commit: u32,
4951 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
4952 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4953 pub name: [u8; 80],
4954 #[doc = "Hardware major version number."]
4955 pub hw_version_major: u8,
4956 #[doc = "Hardware minor version number."]
4957 pub hw_version_minor: u8,
4958 #[doc = "Hardware unique 128-bit ID."]
4959 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4960 pub hw_unique_id: [u8; 16],
4961 #[doc = "Software major version number."]
4962 pub sw_version_major: u8,
4963 #[doc = "Software minor version number."]
4964 pub sw_version_minor: u8,
4965}
4966impl UAVCAN_NODE_INFO_DATA {
4967 pub const ENCODED_LEN: usize = 116usize;
4968 pub const DEFAULT: Self = Self {
4969 time_usec: 0_u64,
4970 uptime_sec: 0_u32,
4971 sw_vcs_commit: 0_u32,
4972 name: [0_u8; 80usize],
4973 hw_version_major: 0_u8,
4974 hw_version_minor: 0_u8,
4975 hw_unique_id: [0_u8; 16usize],
4976 sw_version_major: 0_u8,
4977 sw_version_minor: 0_u8,
4978 };
4979 #[cfg(feature = "arbitrary")]
4980 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4981 use arbitrary::{Arbitrary, Unstructured};
4982 let mut buf = [0u8; 1024];
4983 rng.fill_bytes(&mut buf);
4984 let mut unstructured = Unstructured::new(&buf);
4985 Self::arbitrary(&mut unstructured).unwrap_or_default()
4986 }
4987}
4988impl Default for UAVCAN_NODE_INFO_DATA {
4989 fn default() -> Self {
4990 Self::DEFAULT.clone()
4991 }
4992}
4993impl MessageData for UAVCAN_NODE_INFO_DATA {
4994 type Message = MavMessage;
4995 const ID: u32 = 311u32;
4996 const NAME: &'static str = "UAVCAN_NODE_INFO";
4997 const EXTRA_CRC: u8 = 95u8;
4998 const ENCODED_LEN: usize = 116usize;
4999 fn deser(
5000 _version: MavlinkVersion,
5001 __input: &[u8],
5002 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5003 let avail_len = __input.len();
5004 let mut payload_buf = [0; Self::ENCODED_LEN];
5005 let mut buf = if avail_len < Self::ENCODED_LEN {
5006 payload_buf[0..avail_len].copy_from_slice(__input);
5007 Bytes::new(&payload_buf)
5008 } else {
5009 Bytes::new(__input)
5010 };
5011 let mut __struct = Self::default();
5012 __struct.time_usec = buf.get_u64_le();
5013 __struct.uptime_sec = buf.get_u32_le();
5014 __struct.sw_vcs_commit = buf.get_u32_le();
5015 for v in &mut __struct.name {
5016 let val = buf.get_u8();
5017 *v = val;
5018 }
5019 __struct.hw_version_major = buf.get_u8();
5020 __struct.hw_version_minor = buf.get_u8();
5021 for v in &mut __struct.hw_unique_id {
5022 let val = buf.get_u8();
5023 *v = val;
5024 }
5025 __struct.sw_version_major = buf.get_u8();
5026 __struct.sw_version_minor = buf.get_u8();
5027 Ok(__struct)
5028 }
5029 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5030 let mut __tmp = BytesMut::new(bytes);
5031 #[allow(clippy::absurd_extreme_comparisons)]
5032 #[allow(unused_comparisons)]
5033 if __tmp.remaining() < Self::ENCODED_LEN {
5034 panic!(
5035 "buffer is too small (need {} bytes, but got {})",
5036 Self::ENCODED_LEN,
5037 __tmp.remaining(),
5038 )
5039 }
5040 __tmp.put_u64_le(self.time_usec);
5041 __tmp.put_u32_le(self.uptime_sec);
5042 __tmp.put_u32_le(self.sw_vcs_commit);
5043 for val in &self.name {
5044 __tmp.put_u8(*val);
5045 }
5046 __tmp.put_u8(self.hw_version_major);
5047 __tmp.put_u8(self.hw_version_minor);
5048 for val in &self.hw_unique_id {
5049 __tmp.put_u8(*val);
5050 }
5051 __tmp.put_u8(self.sw_version_major);
5052 __tmp.put_u8(self.sw_version_minor);
5053 if matches!(version, MavlinkVersion::V2) {
5054 let len = __tmp.len();
5055 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5056 } else {
5057 __tmp.len()
5058 }
5059 }
5060}
5061#[doc = "id: 29"]
5062#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
5063#[derive(Debug, Clone, PartialEq)]
5064#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5065#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5066pub struct SCALED_PRESSURE_DATA {
5067 #[doc = "Timestamp (time since system boot)."]
5068 pub time_boot_ms: u32,
5069 #[doc = "Absolute pressure"]
5070 pub press_abs: f32,
5071 #[doc = "Differential pressure 1"]
5072 pub press_diff: f32,
5073 #[doc = "Absolute pressure temperature"]
5074 pub temperature: i16,
5075 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
5076 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5077 pub temperature_press_diff: i16,
5078}
5079impl SCALED_PRESSURE_DATA {
5080 pub const ENCODED_LEN: usize = 16usize;
5081 pub const DEFAULT: Self = Self {
5082 time_boot_ms: 0_u32,
5083 press_abs: 0.0_f32,
5084 press_diff: 0.0_f32,
5085 temperature: 0_i16,
5086 temperature_press_diff: 0_i16,
5087 };
5088 #[cfg(feature = "arbitrary")]
5089 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5090 use arbitrary::{Arbitrary, Unstructured};
5091 let mut buf = [0u8; 1024];
5092 rng.fill_bytes(&mut buf);
5093 let mut unstructured = Unstructured::new(&buf);
5094 Self::arbitrary(&mut unstructured).unwrap_or_default()
5095 }
5096}
5097impl Default for SCALED_PRESSURE_DATA {
5098 fn default() -> Self {
5099 Self::DEFAULT.clone()
5100 }
5101}
5102impl MessageData for SCALED_PRESSURE_DATA {
5103 type Message = MavMessage;
5104 const ID: u32 = 29u32;
5105 const NAME: &'static str = "SCALED_PRESSURE";
5106 const EXTRA_CRC: u8 = 115u8;
5107 const ENCODED_LEN: usize = 16usize;
5108 fn deser(
5109 _version: MavlinkVersion,
5110 __input: &[u8],
5111 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5112 let avail_len = __input.len();
5113 let mut payload_buf = [0; Self::ENCODED_LEN];
5114 let mut buf = if avail_len < Self::ENCODED_LEN {
5115 payload_buf[0..avail_len].copy_from_slice(__input);
5116 Bytes::new(&payload_buf)
5117 } else {
5118 Bytes::new(__input)
5119 };
5120 let mut __struct = Self::default();
5121 __struct.time_boot_ms = buf.get_u32_le();
5122 __struct.press_abs = buf.get_f32_le();
5123 __struct.press_diff = buf.get_f32_le();
5124 __struct.temperature = buf.get_i16_le();
5125 __struct.temperature_press_diff = buf.get_i16_le();
5126 Ok(__struct)
5127 }
5128 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5129 let mut __tmp = BytesMut::new(bytes);
5130 #[allow(clippy::absurd_extreme_comparisons)]
5131 #[allow(unused_comparisons)]
5132 if __tmp.remaining() < Self::ENCODED_LEN {
5133 panic!(
5134 "buffer is too small (need {} bytes, but got {})",
5135 Self::ENCODED_LEN,
5136 __tmp.remaining(),
5137 )
5138 }
5139 __tmp.put_u32_le(self.time_boot_ms);
5140 __tmp.put_f32_le(self.press_abs);
5141 __tmp.put_f32_le(self.press_diff);
5142 __tmp.put_i16_le(self.temperature);
5143 __tmp.put_i16_le(self.temperature_press_diff);
5144 if matches!(version, MavlinkVersion::V2) {
5145 let len = __tmp.len();
5146 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5147 } else {
5148 __tmp.len()
5149 }
5150 }
5151}
5152#[doc = "id: 93"]
5153#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
5154#[derive(Debug, Clone, PartialEq)]
5155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5157pub struct HIL_ACTUATOR_CONTROLS_DATA {
5158 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5159 pub time_usec: u64,
5160 #[doc = "Flags bitmask."]
5161 pub flags: HilActuatorControlsFlags,
5162 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
5163 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5164 pub controls: [f32; 16],
5165 #[doc = "System mode. Includes arming state."]
5166 pub mode: MavModeFlag,
5167}
5168impl HIL_ACTUATOR_CONTROLS_DATA {
5169 pub const ENCODED_LEN: usize = 81usize;
5170 pub const DEFAULT: Self = Self {
5171 time_usec: 0_u64,
5172 flags: HilActuatorControlsFlags::DEFAULT,
5173 controls: [0.0_f32; 16usize],
5174 mode: MavModeFlag::DEFAULT,
5175 };
5176 #[cfg(feature = "arbitrary")]
5177 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5178 use arbitrary::{Arbitrary, Unstructured};
5179 let mut buf = [0u8; 1024];
5180 rng.fill_bytes(&mut buf);
5181 let mut unstructured = Unstructured::new(&buf);
5182 Self::arbitrary(&mut unstructured).unwrap_or_default()
5183 }
5184}
5185impl Default for HIL_ACTUATOR_CONTROLS_DATA {
5186 fn default() -> Self {
5187 Self::DEFAULT.clone()
5188 }
5189}
5190impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
5191 type Message = MavMessage;
5192 const ID: u32 = 93u32;
5193 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
5194 const EXTRA_CRC: u8 = 47u8;
5195 const ENCODED_LEN: usize = 81usize;
5196 fn deser(
5197 _version: MavlinkVersion,
5198 __input: &[u8],
5199 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5200 let avail_len = __input.len();
5201 let mut payload_buf = [0; Self::ENCODED_LEN];
5202 let mut buf = if avail_len < Self::ENCODED_LEN {
5203 payload_buf[0..avail_len].copy_from_slice(__input);
5204 Bytes::new(&payload_buf)
5205 } else {
5206 Bytes::new(__input)
5207 };
5208 let mut __struct = Self::default();
5209 __struct.time_usec = buf.get_u64_le();
5210 let tmp = buf.get_u64_le();
5211 __struct.flags =
5212 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
5213 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5214 flag_type: "HilActuatorControlsFlags",
5215 value: tmp as u32,
5216 })?;
5217 for v in &mut __struct.controls {
5218 let val = buf.get_f32_le();
5219 *v = val;
5220 }
5221 let tmp = buf.get_u8();
5222 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
5223 ::mavlink_core::error::ParserError::InvalidFlag {
5224 flag_type: "MavModeFlag",
5225 value: tmp as u32,
5226 },
5227 )?;
5228 Ok(__struct)
5229 }
5230 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5231 let mut __tmp = BytesMut::new(bytes);
5232 #[allow(clippy::absurd_extreme_comparisons)]
5233 #[allow(unused_comparisons)]
5234 if __tmp.remaining() < Self::ENCODED_LEN {
5235 panic!(
5236 "buffer is too small (need {} bytes, but got {})",
5237 Self::ENCODED_LEN,
5238 __tmp.remaining(),
5239 )
5240 }
5241 __tmp.put_u64_le(self.time_usec);
5242 __tmp.put_u64_le(self.flags.bits());
5243 for val in &self.controls {
5244 __tmp.put_f32_le(*val);
5245 }
5246 __tmp.put_u8(self.mode.bits());
5247 if matches!(version, MavlinkVersion::V2) {
5248 let len = __tmp.len();
5249 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5250 } else {
5251 __tmp.len()
5252 }
5253 }
5254}
5255#[doc = "id: 65"]
5256#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
5257#[derive(Debug, Clone, PartialEq)]
5258#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5259#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5260pub struct RC_CHANNELS_DATA {
5261 #[doc = "Timestamp (time since system boot)."]
5262 pub time_boot_ms: u32,
5263 #[doc = "RC channel 1 value."]
5264 pub chan1_raw: u16,
5265 #[doc = "RC channel 2 value."]
5266 pub chan2_raw: u16,
5267 #[doc = "RC channel 3 value."]
5268 pub chan3_raw: u16,
5269 #[doc = "RC channel 4 value."]
5270 pub chan4_raw: u16,
5271 #[doc = "RC channel 5 value."]
5272 pub chan5_raw: u16,
5273 #[doc = "RC channel 6 value."]
5274 pub chan6_raw: u16,
5275 #[doc = "RC channel 7 value."]
5276 pub chan7_raw: u16,
5277 #[doc = "RC channel 8 value."]
5278 pub chan8_raw: u16,
5279 #[doc = "RC channel 9 value."]
5280 pub chan9_raw: u16,
5281 #[doc = "RC channel 10 value."]
5282 pub chan10_raw: u16,
5283 #[doc = "RC channel 11 value."]
5284 pub chan11_raw: u16,
5285 #[doc = "RC channel 12 value."]
5286 pub chan12_raw: u16,
5287 #[doc = "RC channel 13 value."]
5288 pub chan13_raw: u16,
5289 #[doc = "RC channel 14 value."]
5290 pub chan14_raw: u16,
5291 #[doc = "RC channel 15 value."]
5292 pub chan15_raw: u16,
5293 #[doc = "RC channel 16 value."]
5294 pub chan16_raw: u16,
5295 #[doc = "RC channel 17 value."]
5296 pub chan17_raw: u16,
5297 #[doc = "RC channel 18 value."]
5298 pub chan18_raw: u16,
5299 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
5300 pub chancount: u8,
5301 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
5302 pub rssi: u8,
5303}
5304impl RC_CHANNELS_DATA {
5305 pub const ENCODED_LEN: usize = 42usize;
5306 pub const DEFAULT: Self = Self {
5307 time_boot_ms: 0_u32,
5308 chan1_raw: 0_u16,
5309 chan2_raw: 0_u16,
5310 chan3_raw: 0_u16,
5311 chan4_raw: 0_u16,
5312 chan5_raw: 0_u16,
5313 chan6_raw: 0_u16,
5314 chan7_raw: 0_u16,
5315 chan8_raw: 0_u16,
5316 chan9_raw: 0_u16,
5317 chan10_raw: 0_u16,
5318 chan11_raw: 0_u16,
5319 chan12_raw: 0_u16,
5320 chan13_raw: 0_u16,
5321 chan14_raw: 0_u16,
5322 chan15_raw: 0_u16,
5323 chan16_raw: 0_u16,
5324 chan17_raw: 0_u16,
5325 chan18_raw: 0_u16,
5326 chancount: 0_u8,
5327 rssi: 0_u8,
5328 };
5329 #[cfg(feature = "arbitrary")]
5330 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5331 use arbitrary::{Arbitrary, Unstructured};
5332 let mut buf = [0u8; 1024];
5333 rng.fill_bytes(&mut buf);
5334 let mut unstructured = Unstructured::new(&buf);
5335 Self::arbitrary(&mut unstructured).unwrap_or_default()
5336 }
5337}
5338impl Default for RC_CHANNELS_DATA {
5339 fn default() -> Self {
5340 Self::DEFAULT.clone()
5341 }
5342}
5343impl MessageData for RC_CHANNELS_DATA {
5344 type Message = MavMessage;
5345 const ID: u32 = 65u32;
5346 const NAME: &'static str = "RC_CHANNELS";
5347 const EXTRA_CRC: u8 = 118u8;
5348 const ENCODED_LEN: usize = 42usize;
5349 fn deser(
5350 _version: MavlinkVersion,
5351 __input: &[u8],
5352 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5353 let avail_len = __input.len();
5354 let mut payload_buf = [0; Self::ENCODED_LEN];
5355 let mut buf = if avail_len < Self::ENCODED_LEN {
5356 payload_buf[0..avail_len].copy_from_slice(__input);
5357 Bytes::new(&payload_buf)
5358 } else {
5359 Bytes::new(__input)
5360 };
5361 let mut __struct = Self::default();
5362 __struct.time_boot_ms = buf.get_u32_le();
5363 __struct.chan1_raw = buf.get_u16_le();
5364 __struct.chan2_raw = buf.get_u16_le();
5365 __struct.chan3_raw = buf.get_u16_le();
5366 __struct.chan4_raw = buf.get_u16_le();
5367 __struct.chan5_raw = buf.get_u16_le();
5368 __struct.chan6_raw = buf.get_u16_le();
5369 __struct.chan7_raw = buf.get_u16_le();
5370 __struct.chan8_raw = buf.get_u16_le();
5371 __struct.chan9_raw = buf.get_u16_le();
5372 __struct.chan10_raw = buf.get_u16_le();
5373 __struct.chan11_raw = buf.get_u16_le();
5374 __struct.chan12_raw = buf.get_u16_le();
5375 __struct.chan13_raw = buf.get_u16_le();
5376 __struct.chan14_raw = buf.get_u16_le();
5377 __struct.chan15_raw = buf.get_u16_le();
5378 __struct.chan16_raw = buf.get_u16_le();
5379 __struct.chan17_raw = buf.get_u16_le();
5380 __struct.chan18_raw = buf.get_u16_le();
5381 __struct.chancount = buf.get_u8();
5382 __struct.rssi = buf.get_u8();
5383 Ok(__struct)
5384 }
5385 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5386 let mut __tmp = BytesMut::new(bytes);
5387 #[allow(clippy::absurd_extreme_comparisons)]
5388 #[allow(unused_comparisons)]
5389 if __tmp.remaining() < Self::ENCODED_LEN {
5390 panic!(
5391 "buffer is too small (need {} bytes, but got {})",
5392 Self::ENCODED_LEN,
5393 __tmp.remaining(),
5394 )
5395 }
5396 __tmp.put_u32_le(self.time_boot_ms);
5397 __tmp.put_u16_le(self.chan1_raw);
5398 __tmp.put_u16_le(self.chan2_raw);
5399 __tmp.put_u16_le(self.chan3_raw);
5400 __tmp.put_u16_le(self.chan4_raw);
5401 __tmp.put_u16_le(self.chan5_raw);
5402 __tmp.put_u16_le(self.chan6_raw);
5403 __tmp.put_u16_le(self.chan7_raw);
5404 __tmp.put_u16_le(self.chan8_raw);
5405 __tmp.put_u16_le(self.chan9_raw);
5406 __tmp.put_u16_le(self.chan10_raw);
5407 __tmp.put_u16_le(self.chan11_raw);
5408 __tmp.put_u16_le(self.chan12_raw);
5409 __tmp.put_u16_le(self.chan13_raw);
5410 __tmp.put_u16_le(self.chan14_raw);
5411 __tmp.put_u16_le(self.chan15_raw);
5412 __tmp.put_u16_le(self.chan16_raw);
5413 __tmp.put_u16_le(self.chan17_raw);
5414 __tmp.put_u16_le(self.chan18_raw);
5415 __tmp.put_u8(self.chancount);
5416 __tmp.put_u8(self.rssi);
5417 if matches!(version, MavlinkVersion::V2) {
5418 let len = __tmp.len();
5419 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5420 } else {
5421 __tmp.len()
5422 }
5423 }
5424}
5425#[doc = "id: 49"]
5426#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
5427#[derive(Debug, Clone, PartialEq)]
5428#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5429#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5430pub struct GPS_GLOBAL_ORIGIN_DATA {
5431 #[doc = "Latitude (WGS84)"]
5432 pub latitude: i32,
5433 #[doc = "Longitude (WGS84)"]
5434 pub longitude: i32,
5435 #[doc = "Altitude (MSL). Positive for up."]
5436 pub altitude: i32,
5437 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5438 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5439 pub time_usec: u64,
5440}
5441impl GPS_GLOBAL_ORIGIN_DATA {
5442 pub const ENCODED_LEN: usize = 20usize;
5443 pub const DEFAULT: Self = Self {
5444 latitude: 0_i32,
5445 longitude: 0_i32,
5446 altitude: 0_i32,
5447 time_usec: 0_u64,
5448 };
5449 #[cfg(feature = "arbitrary")]
5450 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5451 use arbitrary::{Arbitrary, Unstructured};
5452 let mut buf = [0u8; 1024];
5453 rng.fill_bytes(&mut buf);
5454 let mut unstructured = Unstructured::new(&buf);
5455 Self::arbitrary(&mut unstructured).unwrap_or_default()
5456 }
5457}
5458impl Default for GPS_GLOBAL_ORIGIN_DATA {
5459 fn default() -> Self {
5460 Self::DEFAULT.clone()
5461 }
5462}
5463impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
5464 type Message = MavMessage;
5465 const ID: u32 = 49u32;
5466 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
5467 const EXTRA_CRC: u8 = 39u8;
5468 const ENCODED_LEN: usize = 20usize;
5469 fn deser(
5470 _version: MavlinkVersion,
5471 __input: &[u8],
5472 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5473 let avail_len = __input.len();
5474 let mut payload_buf = [0; Self::ENCODED_LEN];
5475 let mut buf = if avail_len < Self::ENCODED_LEN {
5476 payload_buf[0..avail_len].copy_from_slice(__input);
5477 Bytes::new(&payload_buf)
5478 } else {
5479 Bytes::new(__input)
5480 };
5481 let mut __struct = Self::default();
5482 __struct.latitude = buf.get_i32_le();
5483 __struct.longitude = buf.get_i32_le();
5484 __struct.altitude = buf.get_i32_le();
5485 __struct.time_usec = buf.get_u64_le();
5486 Ok(__struct)
5487 }
5488 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5489 let mut __tmp = BytesMut::new(bytes);
5490 #[allow(clippy::absurd_extreme_comparisons)]
5491 #[allow(unused_comparisons)]
5492 if __tmp.remaining() < Self::ENCODED_LEN {
5493 panic!(
5494 "buffer is too small (need {} bytes, but got {})",
5495 Self::ENCODED_LEN,
5496 __tmp.remaining(),
5497 )
5498 }
5499 __tmp.put_i32_le(self.latitude);
5500 __tmp.put_i32_le(self.longitude);
5501 __tmp.put_i32_le(self.altitude);
5502 __tmp.put_u64_le(self.time_usec);
5503 if matches!(version, MavlinkVersion::V2) {
5504 let len = __tmp.len();
5505 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5506 } else {
5507 __tmp.len()
5508 }
5509 }
5510}
5511#[doc = "id: 7"]
5512#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5513#[derive(Debug, Clone, PartialEq)]
5514#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5515#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5516pub struct AUTH_KEY_DATA {
5517 #[doc = "key"]
5518 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5519 pub key: [u8; 32],
5520}
5521impl AUTH_KEY_DATA {
5522 pub const ENCODED_LEN: usize = 32usize;
5523 pub const DEFAULT: Self = Self {
5524 key: [0_u8; 32usize],
5525 };
5526 #[cfg(feature = "arbitrary")]
5527 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5528 use arbitrary::{Arbitrary, Unstructured};
5529 let mut buf = [0u8; 1024];
5530 rng.fill_bytes(&mut buf);
5531 let mut unstructured = Unstructured::new(&buf);
5532 Self::arbitrary(&mut unstructured).unwrap_or_default()
5533 }
5534}
5535impl Default for AUTH_KEY_DATA {
5536 fn default() -> Self {
5537 Self::DEFAULT.clone()
5538 }
5539}
5540impl MessageData for AUTH_KEY_DATA {
5541 type Message = MavMessage;
5542 const ID: u32 = 7u32;
5543 const NAME: &'static str = "AUTH_KEY";
5544 const EXTRA_CRC: u8 = 119u8;
5545 const ENCODED_LEN: usize = 32usize;
5546 fn deser(
5547 _version: MavlinkVersion,
5548 __input: &[u8],
5549 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5550 let avail_len = __input.len();
5551 let mut payload_buf = [0; Self::ENCODED_LEN];
5552 let mut buf = if avail_len < Self::ENCODED_LEN {
5553 payload_buf[0..avail_len].copy_from_slice(__input);
5554 Bytes::new(&payload_buf)
5555 } else {
5556 Bytes::new(__input)
5557 };
5558 let mut __struct = Self::default();
5559 for v in &mut __struct.key {
5560 let val = buf.get_u8();
5561 *v = val;
5562 }
5563 Ok(__struct)
5564 }
5565 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5566 let mut __tmp = BytesMut::new(bytes);
5567 #[allow(clippy::absurd_extreme_comparisons)]
5568 #[allow(unused_comparisons)]
5569 if __tmp.remaining() < Self::ENCODED_LEN {
5570 panic!(
5571 "buffer is too small (need {} bytes, but got {})",
5572 Self::ENCODED_LEN,
5573 __tmp.remaining(),
5574 )
5575 }
5576 for val in &self.key {
5577 __tmp.put_u8(*val);
5578 }
5579 if matches!(version, MavlinkVersion::V2) {
5580 let len = __tmp.len();
5581 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5582 } else {
5583 __tmp.len()
5584 }
5585 }
5586}
5587#[doc = "id: 12919"]
5588#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
5589#[derive(Debug, Clone, PartialEq)]
5590#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5591#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5592pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
5593 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
5594 pub operator_latitude: i32,
5595 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
5596 pub operator_longitude: i32,
5597 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
5598 pub operator_altitude_geo: f32,
5599 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
5600 pub timestamp: u32,
5601 #[doc = "System ID (0 for broadcast)."]
5602 pub target_system: u8,
5603 #[doc = "Component ID (0 for broadcast)."]
5604 pub target_component: u8,
5605}
5606impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
5607 pub const ENCODED_LEN: usize = 18usize;
5608 pub const DEFAULT: Self = Self {
5609 operator_latitude: 0_i32,
5610 operator_longitude: 0_i32,
5611 operator_altitude_geo: 0.0_f32,
5612 timestamp: 0_u32,
5613 target_system: 0_u8,
5614 target_component: 0_u8,
5615 };
5616 #[cfg(feature = "arbitrary")]
5617 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5618 use arbitrary::{Arbitrary, Unstructured};
5619 let mut buf = [0u8; 1024];
5620 rng.fill_bytes(&mut buf);
5621 let mut unstructured = Unstructured::new(&buf);
5622 Self::arbitrary(&mut unstructured).unwrap_or_default()
5623 }
5624}
5625impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
5626 fn default() -> Self {
5627 Self::DEFAULT.clone()
5628 }
5629}
5630impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
5631 type Message = MavMessage;
5632 const ID: u32 = 12919u32;
5633 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
5634 const EXTRA_CRC: u8 = 7u8;
5635 const ENCODED_LEN: usize = 18usize;
5636 fn deser(
5637 _version: MavlinkVersion,
5638 __input: &[u8],
5639 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5640 let avail_len = __input.len();
5641 let mut payload_buf = [0; Self::ENCODED_LEN];
5642 let mut buf = if avail_len < Self::ENCODED_LEN {
5643 payload_buf[0..avail_len].copy_from_slice(__input);
5644 Bytes::new(&payload_buf)
5645 } else {
5646 Bytes::new(__input)
5647 };
5648 let mut __struct = Self::default();
5649 __struct.operator_latitude = buf.get_i32_le();
5650 __struct.operator_longitude = buf.get_i32_le();
5651 __struct.operator_altitude_geo = buf.get_f32_le();
5652 __struct.timestamp = buf.get_u32_le();
5653 __struct.target_system = buf.get_u8();
5654 __struct.target_component = buf.get_u8();
5655 Ok(__struct)
5656 }
5657 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5658 let mut __tmp = BytesMut::new(bytes);
5659 #[allow(clippy::absurd_extreme_comparisons)]
5660 #[allow(unused_comparisons)]
5661 if __tmp.remaining() < Self::ENCODED_LEN {
5662 panic!(
5663 "buffer is too small (need {} bytes, but got {})",
5664 Self::ENCODED_LEN,
5665 __tmp.remaining(),
5666 )
5667 }
5668 __tmp.put_i32_le(self.operator_latitude);
5669 __tmp.put_i32_le(self.operator_longitude);
5670 __tmp.put_f32_le(self.operator_altitude_geo);
5671 __tmp.put_u32_le(self.timestamp);
5672 __tmp.put_u8(self.target_system);
5673 __tmp.put_u8(self.target_component);
5674 if matches!(version, MavlinkVersion::V2) {
5675 let len = __tmp.len();
5676 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5677 } else {
5678 __tmp.len()
5679 }
5680 }
5681}
5682#[doc = "id: 390"]
5683#[doc = "Hardware status sent by an onboard computer."]
5684#[derive(Debug, Clone, PartialEq)]
5685#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5686#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5687pub struct ONBOARD_COMPUTER_STATUS_DATA {
5688 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5689 pub time_usec: u64,
5690 #[doc = "Time since system boot."]
5691 pub uptime: u32,
5692 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
5693 pub ram_usage: u32,
5694 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
5695 pub ram_total: u32,
5696 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
5697 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5698 pub storage_type: [u32; 4],
5699 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
5700 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5701 pub storage_usage: [u32; 4],
5702 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
5703 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5704 pub storage_total: [u32; 4],
5705 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
5706 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5707 pub link_type: [u32; 6],
5708 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
5709 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5710 pub link_tx_rate: [u32; 6],
5711 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
5712 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5713 pub link_rx_rate: [u32; 6],
5714 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
5715 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5716 pub link_tx_max: [u32; 6],
5717 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
5718 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5719 pub link_rx_max: [u32; 6],
5720 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
5721 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5722 pub fan_speed: [i16; 4],
5723 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
5724 pub mavtype: u8,
5725 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
5726 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5727 pub cpu_cores: [u8; 8],
5728 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
5729 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5730 pub cpu_combined: [u8; 10],
5731 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
5732 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5733 pub gpu_cores: [u8; 4],
5734 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
5735 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5736 pub gpu_combined: [u8; 10],
5737 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
5738 pub temperature_board: i8,
5739 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
5740 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5741 pub temperature_core: [i8; 8],
5742}
5743impl ONBOARD_COMPUTER_STATUS_DATA {
5744 pub const ENCODED_LEN: usize = 238usize;
5745 pub const DEFAULT: Self = Self {
5746 time_usec: 0_u64,
5747 uptime: 0_u32,
5748 ram_usage: 0_u32,
5749 ram_total: 0_u32,
5750 storage_type: [0_u32; 4usize],
5751 storage_usage: [0_u32; 4usize],
5752 storage_total: [0_u32; 4usize],
5753 link_type: [0_u32; 6usize],
5754 link_tx_rate: [0_u32; 6usize],
5755 link_rx_rate: [0_u32; 6usize],
5756 link_tx_max: [0_u32; 6usize],
5757 link_rx_max: [0_u32; 6usize],
5758 fan_speed: [0_i16; 4usize],
5759 mavtype: 0_u8,
5760 cpu_cores: [0_u8; 8usize],
5761 cpu_combined: [0_u8; 10usize],
5762 gpu_cores: [0_u8; 4usize],
5763 gpu_combined: [0_u8; 10usize],
5764 temperature_board: 0_i8,
5765 temperature_core: [0_i8; 8usize],
5766 };
5767 #[cfg(feature = "arbitrary")]
5768 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5769 use arbitrary::{Arbitrary, Unstructured};
5770 let mut buf = [0u8; 1024];
5771 rng.fill_bytes(&mut buf);
5772 let mut unstructured = Unstructured::new(&buf);
5773 Self::arbitrary(&mut unstructured).unwrap_or_default()
5774 }
5775}
5776impl Default for ONBOARD_COMPUTER_STATUS_DATA {
5777 fn default() -> Self {
5778 Self::DEFAULT.clone()
5779 }
5780}
5781impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
5782 type Message = MavMessage;
5783 const ID: u32 = 390u32;
5784 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
5785 const EXTRA_CRC: u8 = 156u8;
5786 const ENCODED_LEN: usize = 238usize;
5787 fn deser(
5788 _version: MavlinkVersion,
5789 __input: &[u8],
5790 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5791 let avail_len = __input.len();
5792 let mut payload_buf = [0; Self::ENCODED_LEN];
5793 let mut buf = if avail_len < Self::ENCODED_LEN {
5794 payload_buf[0..avail_len].copy_from_slice(__input);
5795 Bytes::new(&payload_buf)
5796 } else {
5797 Bytes::new(__input)
5798 };
5799 let mut __struct = Self::default();
5800 __struct.time_usec = buf.get_u64_le();
5801 __struct.uptime = buf.get_u32_le();
5802 __struct.ram_usage = buf.get_u32_le();
5803 __struct.ram_total = buf.get_u32_le();
5804 for v in &mut __struct.storage_type {
5805 let val = buf.get_u32_le();
5806 *v = val;
5807 }
5808 for v in &mut __struct.storage_usage {
5809 let val = buf.get_u32_le();
5810 *v = val;
5811 }
5812 for v in &mut __struct.storage_total {
5813 let val = buf.get_u32_le();
5814 *v = val;
5815 }
5816 for v in &mut __struct.link_type {
5817 let val = buf.get_u32_le();
5818 *v = val;
5819 }
5820 for v in &mut __struct.link_tx_rate {
5821 let val = buf.get_u32_le();
5822 *v = val;
5823 }
5824 for v in &mut __struct.link_rx_rate {
5825 let val = buf.get_u32_le();
5826 *v = val;
5827 }
5828 for v in &mut __struct.link_tx_max {
5829 let val = buf.get_u32_le();
5830 *v = val;
5831 }
5832 for v in &mut __struct.link_rx_max {
5833 let val = buf.get_u32_le();
5834 *v = val;
5835 }
5836 for v in &mut __struct.fan_speed {
5837 let val = buf.get_i16_le();
5838 *v = val;
5839 }
5840 __struct.mavtype = buf.get_u8();
5841 for v in &mut __struct.cpu_cores {
5842 let val = buf.get_u8();
5843 *v = val;
5844 }
5845 for v in &mut __struct.cpu_combined {
5846 let val = buf.get_u8();
5847 *v = val;
5848 }
5849 for v in &mut __struct.gpu_cores {
5850 let val = buf.get_u8();
5851 *v = val;
5852 }
5853 for v in &mut __struct.gpu_combined {
5854 let val = buf.get_u8();
5855 *v = val;
5856 }
5857 __struct.temperature_board = buf.get_i8();
5858 for v in &mut __struct.temperature_core {
5859 let val = buf.get_i8();
5860 *v = val;
5861 }
5862 Ok(__struct)
5863 }
5864 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5865 let mut __tmp = BytesMut::new(bytes);
5866 #[allow(clippy::absurd_extreme_comparisons)]
5867 #[allow(unused_comparisons)]
5868 if __tmp.remaining() < Self::ENCODED_LEN {
5869 panic!(
5870 "buffer is too small (need {} bytes, but got {})",
5871 Self::ENCODED_LEN,
5872 __tmp.remaining(),
5873 )
5874 }
5875 __tmp.put_u64_le(self.time_usec);
5876 __tmp.put_u32_le(self.uptime);
5877 __tmp.put_u32_le(self.ram_usage);
5878 __tmp.put_u32_le(self.ram_total);
5879 for val in &self.storage_type {
5880 __tmp.put_u32_le(*val);
5881 }
5882 for val in &self.storage_usage {
5883 __tmp.put_u32_le(*val);
5884 }
5885 for val in &self.storage_total {
5886 __tmp.put_u32_le(*val);
5887 }
5888 for val in &self.link_type {
5889 __tmp.put_u32_le(*val);
5890 }
5891 for val in &self.link_tx_rate {
5892 __tmp.put_u32_le(*val);
5893 }
5894 for val in &self.link_rx_rate {
5895 __tmp.put_u32_le(*val);
5896 }
5897 for val in &self.link_tx_max {
5898 __tmp.put_u32_le(*val);
5899 }
5900 for val in &self.link_rx_max {
5901 __tmp.put_u32_le(*val);
5902 }
5903 for val in &self.fan_speed {
5904 __tmp.put_i16_le(*val);
5905 }
5906 __tmp.put_u8(self.mavtype);
5907 for val in &self.cpu_cores {
5908 __tmp.put_u8(*val);
5909 }
5910 for val in &self.cpu_combined {
5911 __tmp.put_u8(*val);
5912 }
5913 for val in &self.gpu_cores {
5914 __tmp.put_u8(*val);
5915 }
5916 for val in &self.gpu_combined {
5917 __tmp.put_u8(*val);
5918 }
5919 __tmp.put_i8(self.temperature_board);
5920 for val in &self.temperature_core {
5921 __tmp.put_i8(*val);
5922 }
5923 if matches!(version, MavlinkVersion::V2) {
5924 let len = __tmp.len();
5925 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5926 } else {
5927 __tmp.len()
5928 }
5929 }
5930}
5931#[doc = "id: 61"]
5932#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5933#[derive(Debug, Clone, PartialEq)]
5934#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5935#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5936pub struct ATTITUDE_QUATERNION_COV_DATA {
5937 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5938 pub time_usec: u64,
5939 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5940 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5941 pub q: [f32; 4],
5942 #[doc = "Roll angular speed"]
5943 pub rollspeed: f32,
5944 #[doc = "Pitch angular speed"]
5945 pub pitchspeed: f32,
5946 #[doc = "Yaw angular speed"]
5947 pub yawspeed: f32,
5948 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5949 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5950 pub covariance: [f32; 9],
5951}
5952impl ATTITUDE_QUATERNION_COV_DATA {
5953 pub const ENCODED_LEN: usize = 72usize;
5954 pub const DEFAULT: Self = Self {
5955 time_usec: 0_u64,
5956 q: [0.0_f32; 4usize],
5957 rollspeed: 0.0_f32,
5958 pitchspeed: 0.0_f32,
5959 yawspeed: 0.0_f32,
5960 covariance: [0.0_f32; 9usize],
5961 };
5962 #[cfg(feature = "arbitrary")]
5963 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5964 use arbitrary::{Arbitrary, Unstructured};
5965 let mut buf = [0u8; 1024];
5966 rng.fill_bytes(&mut buf);
5967 let mut unstructured = Unstructured::new(&buf);
5968 Self::arbitrary(&mut unstructured).unwrap_or_default()
5969 }
5970}
5971impl Default for ATTITUDE_QUATERNION_COV_DATA {
5972 fn default() -> Self {
5973 Self::DEFAULT.clone()
5974 }
5975}
5976impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5977 type Message = MavMessage;
5978 const ID: u32 = 61u32;
5979 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5980 const EXTRA_CRC: u8 = 167u8;
5981 const ENCODED_LEN: usize = 72usize;
5982 fn deser(
5983 _version: MavlinkVersion,
5984 __input: &[u8],
5985 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5986 let avail_len = __input.len();
5987 let mut payload_buf = [0; Self::ENCODED_LEN];
5988 let mut buf = if avail_len < Self::ENCODED_LEN {
5989 payload_buf[0..avail_len].copy_from_slice(__input);
5990 Bytes::new(&payload_buf)
5991 } else {
5992 Bytes::new(__input)
5993 };
5994 let mut __struct = Self::default();
5995 __struct.time_usec = buf.get_u64_le();
5996 for v in &mut __struct.q {
5997 let val = buf.get_f32_le();
5998 *v = val;
5999 }
6000 __struct.rollspeed = buf.get_f32_le();
6001 __struct.pitchspeed = buf.get_f32_le();
6002 __struct.yawspeed = buf.get_f32_le();
6003 for v in &mut __struct.covariance {
6004 let val = buf.get_f32_le();
6005 *v = val;
6006 }
6007 Ok(__struct)
6008 }
6009 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6010 let mut __tmp = BytesMut::new(bytes);
6011 #[allow(clippy::absurd_extreme_comparisons)]
6012 #[allow(unused_comparisons)]
6013 if __tmp.remaining() < Self::ENCODED_LEN {
6014 panic!(
6015 "buffer is too small (need {} bytes, but got {})",
6016 Self::ENCODED_LEN,
6017 __tmp.remaining(),
6018 )
6019 }
6020 __tmp.put_u64_le(self.time_usec);
6021 for val in &self.q {
6022 __tmp.put_f32_le(*val);
6023 }
6024 __tmp.put_f32_le(self.rollspeed);
6025 __tmp.put_f32_le(self.pitchspeed);
6026 __tmp.put_f32_le(self.yawspeed);
6027 for val in &self.covariance {
6028 __tmp.put_f32_le(*val);
6029 }
6030 if matches!(version, MavlinkVersion::V2) {
6031 let len = __tmp.len();
6032 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6033 } else {
6034 __tmp.len()
6035 }
6036 }
6037}
6038#[doc = "id: 45"]
6039#[doc = "Delete all mission items at once."]
6040#[derive(Debug, Clone, PartialEq)]
6041#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6042#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6043pub struct MISSION_CLEAR_ALL_DATA {
6044 #[doc = "System ID"]
6045 pub target_system: u8,
6046 #[doc = "Component ID"]
6047 pub target_component: u8,
6048 #[doc = "Mission type."]
6049 #[cfg_attr(feature = "serde", serde(default))]
6050 pub mission_type: MavMissionType,
6051}
6052impl MISSION_CLEAR_ALL_DATA {
6053 pub const ENCODED_LEN: usize = 3usize;
6054 pub const DEFAULT: Self = Self {
6055 target_system: 0_u8,
6056 target_component: 0_u8,
6057 mission_type: MavMissionType::DEFAULT,
6058 };
6059 #[cfg(feature = "arbitrary")]
6060 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6061 use arbitrary::{Arbitrary, Unstructured};
6062 let mut buf = [0u8; 1024];
6063 rng.fill_bytes(&mut buf);
6064 let mut unstructured = Unstructured::new(&buf);
6065 Self::arbitrary(&mut unstructured).unwrap_or_default()
6066 }
6067}
6068impl Default for MISSION_CLEAR_ALL_DATA {
6069 fn default() -> Self {
6070 Self::DEFAULT.clone()
6071 }
6072}
6073impl MessageData for MISSION_CLEAR_ALL_DATA {
6074 type Message = MavMessage;
6075 const ID: u32 = 45u32;
6076 const NAME: &'static str = "MISSION_CLEAR_ALL";
6077 const EXTRA_CRC: u8 = 232u8;
6078 const ENCODED_LEN: usize = 3usize;
6079 fn deser(
6080 _version: MavlinkVersion,
6081 __input: &[u8],
6082 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6083 let avail_len = __input.len();
6084 let mut payload_buf = [0; Self::ENCODED_LEN];
6085 let mut buf = if avail_len < Self::ENCODED_LEN {
6086 payload_buf[0..avail_len].copy_from_slice(__input);
6087 Bytes::new(&payload_buf)
6088 } else {
6089 Bytes::new(__input)
6090 };
6091 let mut __struct = Self::default();
6092 __struct.target_system = buf.get_u8();
6093 __struct.target_component = buf.get_u8();
6094 let tmp = buf.get_u8();
6095 __struct.mission_type =
6096 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6097 enum_type: "MavMissionType",
6098 value: tmp as u32,
6099 })?;
6100 Ok(__struct)
6101 }
6102 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6103 let mut __tmp = BytesMut::new(bytes);
6104 #[allow(clippy::absurd_extreme_comparisons)]
6105 #[allow(unused_comparisons)]
6106 if __tmp.remaining() < Self::ENCODED_LEN {
6107 panic!(
6108 "buffer is too small (need {} bytes, but got {})",
6109 Self::ENCODED_LEN,
6110 __tmp.remaining(),
6111 )
6112 }
6113 __tmp.put_u8(self.target_system);
6114 __tmp.put_u8(self.target_component);
6115 __tmp.put_u8(self.mission_type as u8);
6116 if matches!(version, MavlinkVersion::V2) {
6117 let len = __tmp.len();
6118 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6119 } else {
6120 __tmp.len()
6121 }
6122 }
6123}
6124#[doc = "id: 120"]
6125#[doc = "Reply to LOG_REQUEST_DATA."]
6126#[derive(Debug, Clone, PartialEq)]
6127#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6128#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6129pub struct LOG_DATA_DATA {
6130 #[doc = "Offset into the log"]
6131 pub ofs: u32,
6132 #[doc = "Log id (from LOG_ENTRY reply)"]
6133 pub id: u16,
6134 #[doc = "Number of bytes (zero for end of log)"]
6135 pub count: u8,
6136 #[doc = "log data"]
6137 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6138 pub data: [u8; 90],
6139}
6140impl LOG_DATA_DATA {
6141 pub const ENCODED_LEN: usize = 97usize;
6142 pub const DEFAULT: Self = Self {
6143 ofs: 0_u32,
6144 id: 0_u16,
6145 count: 0_u8,
6146 data: [0_u8; 90usize],
6147 };
6148 #[cfg(feature = "arbitrary")]
6149 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6150 use arbitrary::{Arbitrary, Unstructured};
6151 let mut buf = [0u8; 1024];
6152 rng.fill_bytes(&mut buf);
6153 let mut unstructured = Unstructured::new(&buf);
6154 Self::arbitrary(&mut unstructured).unwrap_or_default()
6155 }
6156}
6157impl Default for LOG_DATA_DATA {
6158 fn default() -> Self {
6159 Self::DEFAULT.clone()
6160 }
6161}
6162impl MessageData for LOG_DATA_DATA {
6163 type Message = MavMessage;
6164 const ID: u32 = 120u32;
6165 const NAME: &'static str = "LOG_DATA";
6166 const EXTRA_CRC: u8 = 134u8;
6167 const ENCODED_LEN: usize = 97usize;
6168 fn deser(
6169 _version: MavlinkVersion,
6170 __input: &[u8],
6171 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6172 let avail_len = __input.len();
6173 let mut payload_buf = [0; Self::ENCODED_LEN];
6174 let mut buf = if avail_len < Self::ENCODED_LEN {
6175 payload_buf[0..avail_len].copy_from_slice(__input);
6176 Bytes::new(&payload_buf)
6177 } else {
6178 Bytes::new(__input)
6179 };
6180 let mut __struct = Self::default();
6181 __struct.ofs = buf.get_u32_le();
6182 __struct.id = buf.get_u16_le();
6183 __struct.count = buf.get_u8();
6184 for v in &mut __struct.data {
6185 let val = buf.get_u8();
6186 *v = val;
6187 }
6188 Ok(__struct)
6189 }
6190 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6191 let mut __tmp = BytesMut::new(bytes);
6192 #[allow(clippy::absurd_extreme_comparisons)]
6193 #[allow(unused_comparisons)]
6194 if __tmp.remaining() < Self::ENCODED_LEN {
6195 panic!(
6196 "buffer is too small (need {} bytes, but got {})",
6197 Self::ENCODED_LEN,
6198 __tmp.remaining(),
6199 )
6200 }
6201 __tmp.put_u32_le(self.ofs);
6202 __tmp.put_u16_le(self.id);
6203 __tmp.put_u8(self.count);
6204 for val in &self.data {
6205 __tmp.put_u8(*val);
6206 }
6207 if matches!(version, MavlinkVersion::V2) {
6208 let len = __tmp.len();
6209 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6210 } else {
6211 __tmp.len()
6212 }
6213 }
6214}
6215#[doc = "id: 257"]
6216#[doc = "Report button state change."]
6217#[derive(Debug, Clone, PartialEq)]
6218#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6219#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6220pub struct BUTTON_CHANGE_DATA {
6221 #[doc = "Timestamp (time since system boot)."]
6222 pub time_boot_ms: u32,
6223 #[doc = "Time of last change of button state."]
6224 pub last_change_ms: u32,
6225 #[doc = "Bitmap for state of buttons."]
6226 pub state: u8,
6227}
6228impl BUTTON_CHANGE_DATA {
6229 pub const ENCODED_LEN: usize = 9usize;
6230 pub const DEFAULT: Self = Self {
6231 time_boot_ms: 0_u32,
6232 last_change_ms: 0_u32,
6233 state: 0_u8,
6234 };
6235 #[cfg(feature = "arbitrary")]
6236 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6237 use arbitrary::{Arbitrary, Unstructured};
6238 let mut buf = [0u8; 1024];
6239 rng.fill_bytes(&mut buf);
6240 let mut unstructured = Unstructured::new(&buf);
6241 Self::arbitrary(&mut unstructured).unwrap_or_default()
6242 }
6243}
6244impl Default for BUTTON_CHANGE_DATA {
6245 fn default() -> Self {
6246 Self::DEFAULT.clone()
6247 }
6248}
6249impl MessageData for BUTTON_CHANGE_DATA {
6250 type Message = MavMessage;
6251 const ID: u32 = 257u32;
6252 const NAME: &'static str = "BUTTON_CHANGE";
6253 const EXTRA_CRC: u8 = 131u8;
6254 const ENCODED_LEN: usize = 9usize;
6255 fn deser(
6256 _version: MavlinkVersion,
6257 __input: &[u8],
6258 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6259 let avail_len = __input.len();
6260 let mut payload_buf = [0; Self::ENCODED_LEN];
6261 let mut buf = if avail_len < Self::ENCODED_LEN {
6262 payload_buf[0..avail_len].copy_from_slice(__input);
6263 Bytes::new(&payload_buf)
6264 } else {
6265 Bytes::new(__input)
6266 };
6267 let mut __struct = Self::default();
6268 __struct.time_boot_ms = buf.get_u32_le();
6269 __struct.last_change_ms = buf.get_u32_le();
6270 __struct.state = buf.get_u8();
6271 Ok(__struct)
6272 }
6273 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6274 let mut __tmp = BytesMut::new(bytes);
6275 #[allow(clippy::absurd_extreme_comparisons)]
6276 #[allow(unused_comparisons)]
6277 if __tmp.remaining() < Self::ENCODED_LEN {
6278 panic!(
6279 "buffer is too small (need {} bytes, but got {})",
6280 Self::ENCODED_LEN,
6281 __tmp.remaining(),
6282 )
6283 }
6284 __tmp.put_u32_le(self.time_boot_ms);
6285 __tmp.put_u32_le(self.last_change_ms);
6286 __tmp.put_u8(self.state);
6287 if matches!(version, MavlinkVersion::V2) {
6288 let len = __tmp.len();
6289 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6290 } else {
6291 __tmp.len()
6292 }
6293 }
6294}
6295#[doc = "id: 254"]
6296#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
6297#[derive(Debug, Clone, PartialEq)]
6298#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6299#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6300pub struct DEBUG_DATA {
6301 #[doc = "Timestamp (time since system boot)."]
6302 pub time_boot_ms: u32,
6303 #[doc = "DEBUG value"]
6304 pub value: f32,
6305 #[doc = "index of debug variable"]
6306 pub ind: u8,
6307}
6308impl DEBUG_DATA {
6309 pub const ENCODED_LEN: usize = 9usize;
6310 pub const DEFAULT: Self = Self {
6311 time_boot_ms: 0_u32,
6312 value: 0.0_f32,
6313 ind: 0_u8,
6314 };
6315 #[cfg(feature = "arbitrary")]
6316 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6317 use arbitrary::{Arbitrary, Unstructured};
6318 let mut buf = [0u8; 1024];
6319 rng.fill_bytes(&mut buf);
6320 let mut unstructured = Unstructured::new(&buf);
6321 Self::arbitrary(&mut unstructured).unwrap_or_default()
6322 }
6323}
6324impl Default for DEBUG_DATA {
6325 fn default() -> Self {
6326 Self::DEFAULT.clone()
6327 }
6328}
6329impl MessageData for DEBUG_DATA {
6330 type Message = MavMessage;
6331 const ID: u32 = 254u32;
6332 const NAME: &'static str = "DEBUG";
6333 const EXTRA_CRC: u8 = 46u8;
6334 const ENCODED_LEN: usize = 9usize;
6335 fn deser(
6336 _version: MavlinkVersion,
6337 __input: &[u8],
6338 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6339 let avail_len = __input.len();
6340 let mut payload_buf = [0; Self::ENCODED_LEN];
6341 let mut buf = if avail_len < Self::ENCODED_LEN {
6342 payload_buf[0..avail_len].copy_from_slice(__input);
6343 Bytes::new(&payload_buf)
6344 } else {
6345 Bytes::new(__input)
6346 };
6347 let mut __struct = Self::default();
6348 __struct.time_boot_ms = buf.get_u32_le();
6349 __struct.value = buf.get_f32_le();
6350 __struct.ind = buf.get_u8();
6351 Ok(__struct)
6352 }
6353 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6354 let mut __tmp = BytesMut::new(bytes);
6355 #[allow(clippy::absurd_extreme_comparisons)]
6356 #[allow(unused_comparisons)]
6357 if __tmp.remaining() < Self::ENCODED_LEN {
6358 panic!(
6359 "buffer is too small (need {} bytes, but got {})",
6360 Self::ENCODED_LEN,
6361 __tmp.remaining(),
6362 )
6363 }
6364 __tmp.put_u32_le(self.time_boot_ms);
6365 __tmp.put_f32_le(self.value);
6366 __tmp.put_u8(self.ind);
6367 if matches!(version, MavlinkVersion::V2) {
6368 let len = __tmp.len();
6369 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6370 } else {
6371 __tmp.len()
6372 }
6373 }
6374}
6375#[doc = "id: 136"]
6376#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
6377#[derive(Debug, Clone, PartialEq)]
6378#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6379#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6380pub struct TERRAIN_REPORT_DATA {
6381 #[doc = "Latitude"]
6382 pub lat: i32,
6383 #[doc = "Longitude"]
6384 pub lon: i32,
6385 #[doc = "Terrain height MSL"]
6386 pub terrain_height: f32,
6387 #[doc = "Current vehicle height above lat/lon terrain height"]
6388 pub current_height: f32,
6389 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
6390 pub spacing: u16,
6391 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
6392 pub pending: u16,
6393 #[doc = "Number of 4x4 terrain blocks in memory"]
6394 pub loaded: u16,
6395}
6396impl TERRAIN_REPORT_DATA {
6397 pub const ENCODED_LEN: usize = 22usize;
6398 pub const DEFAULT: Self = Self {
6399 lat: 0_i32,
6400 lon: 0_i32,
6401 terrain_height: 0.0_f32,
6402 current_height: 0.0_f32,
6403 spacing: 0_u16,
6404 pending: 0_u16,
6405 loaded: 0_u16,
6406 };
6407 #[cfg(feature = "arbitrary")]
6408 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6409 use arbitrary::{Arbitrary, Unstructured};
6410 let mut buf = [0u8; 1024];
6411 rng.fill_bytes(&mut buf);
6412 let mut unstructured = Unstructured::new(&buf);
6413 Self::arbitrary(&mut unstructured).unwrap_or_default()
6414 }
6415}
6416impl Default for TERRAIN_REPORT_DATA {
6417 fn default() -> Self {
6418 Self::DEFAULT.clone()
6419 }
6420}
6421impl MessageData for TERRAIN_REPORT_DATA {
6422 type Message = MavMessage;
6423 const ID: u32 = 136u32;
6424 const NAME: &'static str = "TERRAIN_REPORT";
6425 const EXTRA_CRC: u8 = 1u8;
6426 const ENCODED_LEN: usize = 22usize;
6427 fn deser(
6428 _version: MavlinkVersion,
6429 __input: &[u8],
6430 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6431 let avail_len = __input.len();
6432 let mut payload_buf = [0; Self::ENCODED_LEN];
6433 let mut buf = if avail_len < Self::ENCODED_LEN {
6434 payload_buf[0..avail_len].copy_from_slice(__input);
6435 Bytes::new(&payload_buf)
6436 } else {
6437 Bytes::new(__input)
6438 };
6439 let mut __struct = Self::default();
6440 __struct.lat = buf.get_i32_le();
6441 __struct.lon = buf.get_i32_le();
6442 __struct.terrain_height = buf.get_f32_le();
6443 __struct.current_height = buf.get_f32_le();
6444 __struct.spacing = buf.get_u16_le();
6445 __struct.pending = buf.get_u16_le();
6446 __struct.loaded = buf.get_u16_le();
6447 Ok(__struct)
6448 }
6449 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6450 let mut __tmp = BytesMut::new(bytes);
6451 #[allow(clippy::absurd_extreme_comparisons)]
6452 #[allow(unused_comparisons)]
6453 if __tmp.remaining() < Self::ENCODED_LEN {
6454 panic!(
6455 "buffer is too small (need {} bytes, but got {})",
6456 Self::ENCODED_LEN,
6457 __tmp.remaining(),
6458 )
6459 }
6460 __tmp.put_i32_le(self.lat);
6461 __tmp.put_i32_le(self.lon);
6462 __tmp.put_f32_le(self.terrain_height);
6463 __tmp.put_f32_le(self.current_height);
6464 __tmp.put_u16_le(self.spacing);
6465 __tmp.put_u16_le(self.pending);
6466 __tmp.put_u16_le(self.loaded);
6467 if matches!(version, MavlinkVersion::V2) {
6468 let len = __tmp.len();
6469 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6470 } else {
6471 __tmp.len()
6472 }
6473 }
6474}
6475#[doc = "id: 5"]
6476#[doc = "Request to control this MAV."]
6477#[derive(Debug, Clone, PartialEq)]
6478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6479#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6480pub struct CHANGE_OPERATOR_CONTROL_DATA {
6481 #[doc = "System the GCS requests control for"]
6482 pub target_system: u8,
6483 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
6484 pub control_request: u8,
6485 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
6486 pub version: u8,
6487 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
6488 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6489 pub passkey: [u8; 25],
6490}
6491impl CHANGE_OPERATOR_CONTROL_DATA {
6492 pub const ENCODED_LEN: usize = 28usize;
6493 pub const DEFAULT: Self = Self {
6494 target_system: 0_u8,
6495 control_request: 0_u8,
6496 version: 0_u8,
6497 passkey: [0_u8; 25usize],
6498 };
6499 #[cfg(feature = "arbitrary")]
6500 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6501 use arbitrary::{Arbitrary, Unstructured};
6502 let mut buf = [0u8; 1024];
6503 rng.fill_bytes(&mut buf);
6504 let mut unstructured = Unstructured::new(&buf);
6505 Self::arbitrary(&mut unstructured).unwrap_or_default()
6506 }
6507}
6508impl Default for CHANGE_OPERATOR_CONTROL_DATA {
6509 fn default() -> Self {
6510 Self::DEFAULT.clone()
6511 }
6512}
6513impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
6514 type Message = MavMessage;
6515 const ID: u32 = 5u32;
6516 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
6517 const EXTRA_CRC: u8 = 217u8;
6518 const ENCODED_LEN: usize = 28usize;
6519 fn deser(
6520 _version: MavlinkVersion,
6521 __input: &[u8],
6522 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6523 let avail_len = __input.len();
6524 let mut payload_buf = [0; Self::ENCODED_LEN];
6525 let mut buf = if avail_len < Self::ENCODED_LEN {
6526 payload_buf[0..avail_len].copy_from_slice(__input);
6527 Bytes::new(&payload_buf)
6528 } else {
6529 Bytes::new(__input)
6530 };
6531 let mut __struct = Self::default();
6532 __struct.target_system = buf.get_u8();
6533 __struct.control_request = buf.get_u8();
6534 __struct.version = buf.get_u8();
6535 for v in &mut __struct.passkey {
6536 let val = buf.get_u8();
6537 *v = val;
6538 }
6539 Ok(__struct)
6540 }
6541 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6542 let mut __tmp = BytesMut::new(bytes);
6543 #[allow(clippy::absurd_extreme_comparisons)]
6544 #[allow(unused_comparisons)]
6545 if __tmp.remaining() < Self::ENCODED_LEN {
6546 panic!(
6547 "buffer is too small (need {} bytes, but got {})",
6548 Self::ENCODED_LEN,
6549 __tmp.remaining(),
6550 )
6551 }
6552 __tmp.put_u8(self.target_system);
6553 __tmp.put_u8(self.control_request);
6554 __tmp.put_u8(self.version);
6555 for val in &self.passkey {
6556 __tmp.put_u8(*val);
6557 }
6558 if matches!(version, MavlinkVersion::V2) {
6559 let len = __tmp.len();
6560 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6561 } else {
6562 __tmp.len()
6563 }
6564 }
6565}
6566#[doc = "id: 225"]
6567#[doc = "EFI status output."]
6568#[derive(Debug, Clone, PartialEq)]
6569#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6570#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6571pub struct EFI_STATUS_DATA {
6572 #[doc = "ECU index"]
6573 pub ecu_index: f32,
6574 #[doc = "RPM"]
6575 pub rpm: f32,
6576 #[doc = "Fuel consumed"]
6577 pub fuel_consumed: f32,
6578 #[doc = "Fuel flow rate"]
6579 pub fuel_flow: f32,
6580 #[doc = "Engine load"]
6581 pub engine_load: f32,
6582 #[doc = "Throttle position"]
6583 pub throttle_position: f32,
6584 #[doc = "Spark dwell time"]
6585 pub spark_dwell_time: f32,
6586 #[doc = "Barometric pressure"]
6587 pub barometric_pressure: f32,
6588 #[doc = "Intake manifold pressure("]
6589 pub intake_manifold_pressure: f32,
6590 #[doc = "Intake manifold temperature"]
6591 pub intake_manifold_temperature: f32,
6592 #[doc = "Cylinder head temperature"]
6593 pub cylinder_head_temperature: f32,
6594 #[doc = "Ignition timing (Crank angle degrees)"]
6595 pub ignition_timing: f32,
6596 #[doc = "Injection time"]
6597 pub injection_time: f32,
6598 #[doc = "Exhaust gas temperature"]
6599 pub exhaust_gas_temperature: f32,
6600 #[doc = "Output throttle"]
6601 pub throttle_out: f32,
6602 #[doc = "Pressure/temperature compensation"]
6603 pub pt_compensation: f32,
6604 #[doc = "EFI health status"]
6605 pub health: u8,
6606 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
6607 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6608 pub ignition_voltage: f32,
6609 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
6610 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6611 pub fuel_pressure: f32,
6612}
6613impl EFI_STATUS_DATA {
6614 pub const ENCODED_LEN: usize = 73usize;
6615 pub const DEFAULT: Self = Self {
6616 ecu_index: 0.0_f32,
6617 rpm: 0.0_f32,
6618 fuel_consumed: 0.0_f32,
6619 fuel_flow: 0.0_f32,
6620 engine_load: 0.0_f32,
6621 throttle_position: 0.0_f32,
6622 spark_dwell_time: 0.0_f32,
6623 barometric_pressure: 0.0_f32,
6624 intake_manifold_pressure: 0.0_f32,
6625 intake_manifold_temperature: 0.0_f32,
6626 cylinder_head_temperature: 0.0_f32,
6627 ignition_timing: 0.0_f32,
6628 injection_time: 0.0_f32,
6629 exhaust_gas_temperature: 0.0_f32,
6630 throttle_out: 0.0_f32,
6631 pt_compensation: 0.0_f32,
6632 health: 0_u8,
6633 ignition_voltage: 0.0_f32,
6634 fuel_pressure: 0.0_f32,
6635 };
6636 #[cfg(feature = "arbitrary")]
6637 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6638 use arbitrary::{Arbitrary, Unstructured};
6639 let mut buf = [0u8; 1024];
6640 rng.fill_bytes(&mut buf);
6641 let mut unstructured = Unstructured::new(&buf);
6642 Self::arbitrary(&mut unstructured).unwrap_or_default()
6643 }
6644}
6645impl Default for EFI_STATUS_DATA {
6646 fn default() -> Self {
6647 Self::DEFAULT.clone()
6648 }
6649}
6650impl MessageData for EFI_STATUS_DATA {
6651 type Message = MavMessage;
6652 const ID: u32 = 225u32;
6653 const NAME: &'static str = "EFI_STATUS";
6654 const EXTRA_CRC: u8 = 208u8;
6655 const ENCODED_LEN: usize = 73usize;
6656 fn deser(
6657 _version: MavlinkVersion,
6658 __input: &[u8],
6659 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6660 let avail_len = __input.len();
6661 let mut payload_buf = [0; Self::ENCODED_LEN];
6662 let mut buf = if avail_len < Self::ENCODED_LEN {
6663 payload_buf[0..avail_len].copy_from_slice(__input);
6664 Bytes::new(&payload_buf)
6665 } else {
6666 Bytes::new(__input)
6667 };
6668 let mut __struct = Self::default();
6669 __struct.ecu_index = buf.get_f32_le();
6670 __struct.rpm = buf.get_f32_le();
6671 __struct.fuel_consumed = buf.get_f32_le();
6672 __struct.fuel_flow = buf.get_f32_le();
6673 __struct.engine_load = buf.get_f32_le();
6674 __struct.throttle_position = buf.get_f32_le();
6675 __struct.spark_dwell_time = buf.get_f32_le();
6676 __struct.barometric_pressure = buf.get_f32_le();
6677 __struct.intake_manifold_pressure = buf.get_f32_le();
6678 __struct.intake_manifold_temperature = buf.get_f32_le();
6679 __struct.cylinder_head_temperature = buf.get_f32_le();
6680 __struct.ignition_timing = buf.get_f32_le();
6681 __struct.injection_time = buf.get_f32_le();
6682 __struct.exhaust_gas_temperature = buf.get_f32_le();
6683 __struct.throttle_out = buf.get_f32_le();
6684 __struct.pt_compensation = buf.get_f32_le();
6685 __struct.health = buf.get_u8();
6686 __struct.ignition_voltage = buf.get_f32_le();
6687 __struct.fuel_pressure = buf.get_f32_le();
6688 Ok(__struct)
6689 }
6690 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6691 let mut __tmp = BytesMut::new(bytes);
6692 #[allow(clippy::absurd_extreme_comparisons)]
6693 #[allow(unused_comparisons)]
6694 if __tmp.remaining() < Self::ENCODED_LEN {
6695 panic!(
6696 "buffer is too small (need {} bytes, but got {})",
6697 Self::ENCODED_LEN,
6698 __tmp.remaining(),
6699 )
6700 }
6701 __tmp.put_f32_le(self.ecu_index);
6702 __tmp.put_f32_le(self.rpm);
6703 __tmp.put_f32_le(self.fuel_consumed);
6704 __tmp.put_f32_le(self.fuel_flow);
6705 __tmp.put_f32_le(self.engine_load);
6706 __tmp.put_f32_le(self.throttle_position);
6707 __tmp.put_f32_le(self.spark_dwell_time);
6708 __tmp.put_f32_le(self.barometric_pressure);
6709 __tmp.put_f32_le(self.intake_manifold_pressure);
6710 __tmp.put_f32_le(self.intake_manifold_temperature);
6711 __tmp.put_f32_le(self.cylinder_head_temperature);
6712 __tmp.put_f32_le(self.ignition_timing);
6713 __tmp.put_f32_le(self.injection_time);
6714 __tmp.put_f32_le(self.exhaust_gas_temperature);
6715 __tmp.put_f32_le(self.throttle_out);
6716 __tmp.put_f32_le(self.pt_compensation);
6717 __tmp.put_u8(self.health);
6718 __tmp.put_f32_le(self.ignition_voltage);
6719 __tmp.put_f32_le(self.fuel_pressure);
6720 if matches!(version, MavlinkVersion::V2) {
6721 let len = __tmp.len();
6722 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6723 } else {
6724 __tmp.len()
6725 }
6726 }
6727}
6728#[doc = "id: 77"]
6729#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
6730#[derive(Debug, Clone, PartialEq)]
6731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6733pub struct COMMAND_ACK_DATA {
6734 #[doc = "Command ID (of acknowledged command)."]
6735 pub command: MavCmd,
6736 #[doc = "Result of command."]
6737 pub result: MavResult,
6738 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
6739 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6740 pub progress: u8,
6741 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
6742 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6743 pub result_param2: i32,
6744 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
6745 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6746 pub target_system: u8,
6747 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
6748 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6749 pub target_component: u8,
6750}
6751impl COMMAND_ACK_DATA {
6752 pub const ENCODED_LEN: usize = 10usize;
6753 pub const DEFAULT: Self = Self {
6754 command: MavCmd::DEFAULT,
6755 result: MavResult::DEFAULT,
6756 progress: 0_u8,
6757 result_param2: 0_i32,
6758 target_system: 0_u8,
6759 target_component: 0_u8,
6760 };
6761 #[cfg(feature = "arbitrary")]
6762 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6763 use arbitrary::{Arbitrary, Unstructured};
6764 let mut buf = [0u8; 1024];
6765 rng.fill_bytes(&mut buf);
6766 let mut unstructured = Unstructured::new(&buf);
6767 Self::arbitrary(&mut unstructured).unwrap_or_default()
6768 }
6769}
6770impl Default for COMMAND_ACK_DATA {
6771 fn default() -> Self {
6772 Self::DEFAULT.clone()
6773 }
6774}
6775impl MessageData for COMMAND_ACK_DATA {
6776 type Message = MavMessage;
6777 const ID: u32 = 77u32;
6778 const NAME: &'static str = "COMMAND_ACK";
6779 const EXTRA_CRC: u8 = 143u8;
6780 const ENCODED_LEN: usize = 10usize;
6781 fn deser(
6782 _version: MavlinkVersion,
6783 __input: &[u8],
6784 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6785 let avail_len = __input.len();
6786 let mut payload_buf = [0; Self::ENCODED_LEN];
6787 let mut buf = if avail_len < Self::ENCODED_LEN {
6788 payload_buf[0..avail_len].copy_from_slice(__input);
6789 Bytes::new(&payload_buf)
6790 } else {
6791 Bytes::new(__input)
6792 };
6793 let mut __struct = Self::default();
6794 let tmp = buf.get_u16_le();
6795 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
6796 ::mavlink_core::error::ParserError::InvalidEnum {
6797 enum_type: "MavCmd",
6798 value: tmp as u32,
6799 },
6800 )?;
6801 let tmp = buf.get_u8();
6802 __struct.result =
6803 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6804 enum_type: "MavResult",
6805 value: tmp as u32,
6806 })?;
6807 __struct.progress = buf.get_u8();
6808 __struct.result_param2 = buf.get_i32_le();
6809 __struct.target_system = buf.get_u8();
6810 __struct.target_component = buf.get_u8();
6811 Ok(__struct)
6812 }
6813 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6814 let mut __tmp = BytesMut::new(bytes);
6815 #[allow(clippy::absurd_extreme_comparisons)]
6816 #[allow(unused_comparisons)]
6817 if __tmp.remaining() < Self::ENCODED_LEN {
6818 panic!(
6819 "buffer is too small (need {} bytes, but got {})",
6820 Self::ENCODED_LEN,
6821 __tmp.remaining(),
6822 )
6823 }
6824 __tmp.put_u16_le(self.command as u16);
6825 __tmp.put_u8(self.result as u8);
6826 __tmp.put_u8(self.progress);
6827 __tmp.put_i32_le(self.result_param2);
6828 __tmp.put_u8(self.target_system);
6829 __tmp.put_u8(self.target_component);
6830 if matches!(version, MavlinkVersion::V2) {
6831 let len = __tmp.len();
6832 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6833 } else {
6834 __tmp.len()
6835 }
6836 }
6837}
6838#[doc = "id: 321"]
6839#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
6840#[derive(Debug, Clone, PartialEq)]
6841#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6842#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6843pub struct PARAM_EXT_REQUEST_LIST_DATA {
6844 #[doc = "System ID"]
6845 pub target_system: u8,
6846 #[doc = "Component ID"]
6847 pub target_component: u8,
6848}
6849impl PARAM_EXT_REQUEST_LIST_DATA {
6850 pub const ENCODED_LEN: usize = 2usize;
6851 pub const DEFAULT: Self = Self {
6852 target_system: 0_u8,
6853 target_component: 0_u8,
6854 };
6855 #[cfg(feature = "arbitrary")]
6856 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6857 use arbitrary::{Arbitrary, Unstructured};
6858 let mut buf = [0u8; 1024];
6859 rng.fill_bytes(&mut buf);
6860 let mut unstructured = Unstructured::new(&buf);
6861 Self::arbitrary(&mut unstructured).unwrap_or_default()
6862 }
6863}
6864impl Default for PARAM_EXT_REQUEST_LIST_DATA {
6865 fn default() -> Self {
6866 Self::DEFAULT.clone()
6867 }
6868}
6869impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
6870 type Message = MavMessage;
6871 const ID: u32 = 321u32;
6872 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
6873 const EXTRA_CRC: u8 = 88u8;
6874 const ENCODED_LEN: usize = 2usize;
6875 fn deser(
6876 _version: MavlinkVersion,
6877 __input: &[u8],
6878 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6879 let avail_len = __input.len();
6880 let mut payload_buf = [0; Self::ENCODED_LEN];
6881 let mut buf = if avail_len < Self::ENCODED_LEN {
6882 payload_buf[0..avail_len].copy_from_slice(__input);
6883 Bytes::new(&payload_buf)
6884 } else {
6885 Bytes::new(__input)
6886 };
6887 let mut __struct = Self::default();
6888 __struct.target_system = buf.get_u8();
6889 __struct.target_component = buf.get_u8();
6890 Ok(__struct)
6891 }
6892 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6893 let mut __tmp = BytesMut::new(bytes);
6894 #[allow(clippy::absurd_extreme_comparisons)]
6895 #[allow(unused_comparisons)]
6896 if __tmp.remaining() < Self::ENCODED_LEN {
6897 panic!(
6898 "buffer is too small (need {} bytes, but got {})",
6899 Self::ENCODED_LEN,
6900 __tmp.remaining(),
6901 )
6902 }
6903 __tmp.put_u8(self.target_system);
6904 __tmp.put_u8(self.target_component);
6905 if matches!(version, MavlinkVersion::V2) {
6906 let len = __tmp.len();
6907 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6908 } else {
6909 __tmp.len()
6910 }
6911 }
6912}
6913#[doc = "id: 46"]
6914#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
6915#[derive(Debug, Clone, PartialEq)]
6916#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6917#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6918pub struct MISSION_ITEM_REACHED_DATA {
6919 #[doc = "Sequence"]
6920 pub seq: u16,
6921}
6922impl MISSION_ITEM_REACHED_DATA {
6923 pub const ENCODED_LEN: usize = 2usize;
6924 pub const DEFAULT: Self = Self { seq: 0_u16 };
6925 #[cfg(feature = "arbitrary")]
6926 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6927 use arbitrary::{Arbitrary, Unstructured};
6928 let mut buf = [0u8; 1024];
6929 rng.fill_bytes(&mut buf);
6930 let mut unstructured = Unstructured::new(&buf);
6931 Self::arbitrary(&mut unstructured).unwrap_or_default()
6932 }
6933}
6934impl Default for MISSION_ITEM_REACHED_DATA {
6935 fn default() -> Self {
6936 Self::DEFAULT.clone()
6937 }
6938}
6939impl MessageData for MISSION_ITEM_REACHED_DATA {
6940 type Message = MavMessage;
6941 const ID: u32 = 46u32;
6942 const NAME: &'static str = "MISSION_ITEM_REACHED";
6943 const EXTRA_CRC: u8 = 11u8;
6944 const ENCODED_LEN: usize = 2usize;
6945 fn deser(
6946 _version: MavlinkVersion,
6947 __input: &[u8],
6948 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6949 let avail_len = __input.len();
6950 let mut payload_buf = [0; Self::ENCODED_LEN];
6951 let mut buf = if avail_len < Self::ENCODED_LEN {
6952 payload_buf[0..avail_len].copy_from_slice(__input);
6953 Bytes::new(&payload_buf)
6954 } else {
6955 Bytes::new(__input)
6956 };
6957 let mut __struct = Self::default();
6958 __struct.seq = buf.get_u16_le();
6959 Ok(__struct)
6960 }
6961 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6962 let mut __tmp = BytesMut::new(bytes);
6963 #[allow(clippy::absurd_extreme_comparisons)]
6964 #[allow(unused_comparisons)]
6965 if __tmp.remaining() < Self::ENCODED_LEN {
6966 panic!(
6967 "buffer is too small (need {} bytes, but got {})",
6968 Self::ENCODED_LEN,
6969 __tmp.remaining(),
6970 )
6971 }
6972 __tmp.put_u16_le(self.seq);
6973 if matches!(version, MavlinkVersion::V2) {
6974 let len = __tmp.len();
6975 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6976 } else {
6977 __tmp.len()
6978 }
6979 }
6980}
6981#[doc = "id: 132"]
6982#[doc = "Distance sensor information for an onboard rangefinder."]
6983#[derive(Debug, Clone, PartialEq)]
6984#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6985#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6986pub struct DISTANCE_SENSOR_DATA {
6987 #[doc = "Timestamp (time since system boot)."]
6988 pub time_boot_ms: u32,
6989 #[doc = "Minimum distance the sensor can measure"]
6990 pub min_distance: u16,
6991 #[doc = "Maximum distance the sensor can measure"]
6992 pub max_distance: u16,
6993 #[doc = "Current distance reading"]
6994 pub current_distance: u16,
6995 #[doc = "Type of distance sensor."]
6996 pub mavtype: MavDistanceSensor,
6997 #[doc = "Onboard ID of the sensor"]
6998 pub id: u8,
6999 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
7000 pub orientation: MavSensorOrientation,
7001 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
7002 pub covariance: u8,
7003 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
7004 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7005 pub horizontal_fov: f32,
7006 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
7007 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7008 pub vertical_fov: f32,
7009 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
7010 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7011 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7012 pub quaternion: [f32; 4],
7013 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
7014 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7015 pub signal_quality: u8,
7016}
7017impl DISTANCE_SENSOR_DATA {
7018 pub const ENCODED_LEN: usize = 39usize;
7019 pub const DEFAULT: Self = Self {
7020 time_boot_ms: 0_u32,
7021 min_distance: 0_u16,
7022 max_distance: 0_u16,
7023 current_distance: 0_u16,
7024 mavtype: MavDistanceSensor::DEFAULT,
7025 id: 0_u8,
7026 orientation: MavSensorOrientation::DEFAULT,
7027 covariance: 0_u8,
7028 horizontal_fov: 0.0_f32,
7029 vertical_fov: 0.0_f32,
7030 quaternion: [0.0_f32; 4usize],
7031 signal_quality: 0_u8,
7032 };
7033 #[cfg(feature = "arbitrary")]
7034 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7035 use arbitrary::{Arbitrary, Unstructured};
7036 let mut buf = [0u8; 1024];
7037 rng.fill_bytes(&mut buf);
7038 let mut unstructured = Unstructured::new(&buf);
7039 Self::arbitrary(&mut unstructured).unwrap_or_default()
7040 }
7041}
7042impl Default for DISTANCE_SENSOR_DATA {
7043 fn default() -> Self {
7044 Self::DEFAULT.clone()
7045 }
7046}
7047impl MessageData for DISTANCE_SENSOR_DATA {
7048 type Message = MavMessage;
7049 const ID: u32 = 132u32;
7050 const NAME: &'static str = "DISTANCE_SENSOR";
7051 const EXTRA_CRC: u8 = 85u8;
7052 const ENCODED_LEN: usize = 39usize;
7053 fn deser(
7054 _version: MavlinkVersion,
7055 __input: &[u8],
7056 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7057 let avail_len = __input.len();
7058 let mut payload_buf = [0; Self::ENCODED_LEN];
7059 let mut buf = if avail_len < Self::ENCODED_LEN {
7060 payload_buf[0..avail_len].copy_from_slice(__input);
7061 Bytes::new(&payload_buf)
7062 } else {
7063 Bytes::new(__input)
7064 };
7065 let mut __struct = Self::default();
7066 __struct.time_boot_ms = buf.get_u32_le();
7067 __struct.min_distance = buf.get_u16_le();
7068 __struct.max_distance = buf.get_u16_le();
7069 __struct.current_distance = buf.get_u16_le();
7070 let tmp = buf.get_u8();
7071 __struct.mavtype =
7072 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7073 enum_type: "MavDistanceSensor",
7074 value: tmp as u32,
7075 })?;
7076 __struct.id = buf.get_u8();
7077 let tmp = buf.get_u8();
7078 __struct.orientation =
7079 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7080 enum_type: "MavSensorOrientation",
7081 value: tmp as u32,
7082 })?;
7083 __struct.covariance = buf.get_u8();
7084 __struct.horizontal_fov = buf.get_f32_le();
7085 __struct.vertical_fov = buf.get_f32_le();
7086 for v in &mut __struct.quaternion {
7087 let val = buf.get_f32_le();
7088 *v = val;
7089 }
7090 __struct.signal_quality = buf.get_u8();
7091 Ok(__struct)
7092 }
7093 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7094 let mut __tmp = BytesMut::new(bytes);
7095 #[allow(clippy::absurd_extreme_comparisons)]
7096 #[allow(unused_comparisons)]
7097 if __tmp.remaining() < Self::ENCODED_LEN {
7098 panic!(
7099 "buffer is too small (need {} bytes, but got {})",
7100 Self::ENCODED_LEN,
7101 __tmp.remaining(),
7102 )
7103 }
7104 __tmp.put_u32_le(self.time_boot_ms);
7105 __tmp.put_u16_le(self.min_distance);
7106 __tmp.put_u16_le(self.max_distance);
7107 __tmp.put_u16_le(self.current_distance);
7108 __tmp.put_u8(self.mavtype as u8);
7109 __tmp.put_u8(self.id);
7110 __tmp.put_u8(self.orientation as u8);
7111 __tmp.put_u8(self.covariance);
7112 __tmp.put_f32_le(self.horizontal_fov);
7113 __tmp.put_f32_le(self.vertical_fov);
7114 for val in &self.quaternion {
7115 __tmp.put_f32_le(*val);
7116 }
7117 __tmp.put_u8(self.signal_quality);
7118 if matches!(version, MavlinkVersion::V2) {
7119 let len = __tmp.len();
7120 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7121 } else {
7122 __tmp.len()
7123 }
7124 }
7125}
7126#[doc = "id: 12920"]
7127#[doc = "Temperature and humidity from hygrometer."]
7128#[derive(Debug, Clone, PartialEq)]
7129#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7131pub struct HYGROMETER_SENSOR_DATA {
7132 #[doc = "Temperature"]
7133 pub temperature: i16,
7134 #[doc = "Humidity"]
7135 pub humidity: u16,
7136 #[doc = "Hygrometer ID"]
7137 pub id: u8,
7138}
7139impl HYGROMETER_SENSOR_DATA {
7140 pub const ENCODED_LEN: usize = 5usize;
7141 pub const DEFAULT: Self = Self {
7142 temperature: 0_i16,
7143 humidity: 0_u16,
7144 id: 0_u8,
7145 };
7146 #[cfg(feature = "arbitrary")]
7147 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7148 use arbitrary::{Arbitrary, Unstructured};
7149 let mut buf = [0u8; 1024];
7150 rng.fill_bytes(&mut buf);
7151 let mut unstructured = Unstructured::new(&buf);
7152 Self::arbitrary(&mut unstructured).unwrap_or_default()
7153 }
7154}
7155impl Default for HYGROMETER_SENSOR_DATA {
7156 fn default() -> Self {
7157 Self::DEFAULT.clone()
7158 }
7159}
7160impl MessageData for HYGROMETER_SENSOR_DATA {
7161 type Message = MavMessage;
7162 const ID: u32 = 12920u32;
7163 const NAME: &'static str = "HYGROMETER_SENSOR";
7164 const EXTRA_CRC: u8 = 20u8;
7165 const ENCODED_LEN: usize = 5usize;
7166 fn deser(
7167 _version: MavlinkVersion,
7168 __input: &[u8],
7169 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7170 let avail_len = __input.len();
7171 let mut payload_buf = [0; Self::ENCODED_LEN];
7172 let mut buf = if avail_len < Self::ENCODED_LEN {
7173 payload_buf[0..avail_len].copy_from_slice(__input);
7174 Bytes::new(&payload_buf)
7175 } else {
7176 Bytes::new(__input)
7177 };
7178 let mut __struct = Self::default();
7179 __struct.temperature = buf.get_i16_le();
7180 __struct.humidity = buf.get_u16_le();
7181 __struct.id = buf.get_u8();
7182 Ok(__struct)
7183 }
7184 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7185 let mut __tmp = BytesMut::new(bytes);
7186 #[allow(clippy::absurd_extreme_comparisons)]
7187 #[allow(unused_comparisons)]
7188 if __tmp.remaining() < Self::ENCODED_LEN {
7189 panic!(
7190 "buffer is too small (need {} bytes, but got {})",
7191 Self::ENCODED_LEN,
7192 __tmp.remaining(),
7193 )
7194 }
7195 __tmp.put_i16_le(self.temperature);
7196 __tmp.put_u16_le(self.humidity);
7197 __tmp.put_u8(self.id);
7198 if matches!(version, MavlinkVersion::V2) {
7199 let len = __tmp.len();
7200 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7201 } else {
7202 __tmp.len()
7203 }
7204 }
7205}
7206#[doc = "id: 435"]
7207#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
7208#[derive(Debug, Clone, PartialEq)]
7209#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7210#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7211pub struct AVAILABLE_MODES_DATA {
7212 #[doc = "A bitfield for use for autopilot-specific flags"]
7213 pub custom_mode: u32,
7214 #[doc = "Mode properties."]
7215 pub properties: MavModeProperty,
7216 #[doc = "The total number of available modes for the current vehicle type."]
7217 pub number_modes: u8,
7218 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
7219 pub mode_index: u8,
7220 #[doc = "Standard mode."]
7221 pub standard_mode: MavStandardMode,
7222 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
7223 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7224 pub mode_name: [u8; 35],
7225}
7226impl AVAILABLE_MODES_DATA {
7227 pub const ENCODED_LEN: usize = 46usize;
7228 pub const DEFAULT: Self = Self {
7229 custom_mode: 0_u32,
7230 properties: MavModeProperty::DEFAULT,
7231 number_modes: 0_u8,
7232 mode_index: 0_u8,
7233 standard_mode: MavStandardMode::DEFAULT,
7234 mode_name: [0_u8; 35usize],
7235 };
7236 #[cfg(feature = "arbitrary")]
7237 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7238 use arbitrary::{Arbitrary, Unstructured};
7239 let mut buf = [0u8; 1024];
7240 rng.fill_bytes(&mut buf);
7241 let mut unstructured = Unstructured::new(&buf);
7242 Self::arbitrary(&mut unstructured).unwrap_or_default()
7243 }
7244}
7245impl Default for AVAILABLE_MODES_DATA {
7246 fn default() -> Self {
7247 Self::DEFAULT.clone()
7248 }
7249}
7250impl MessageData for AVAILABLE_MODES_DATA {
7251 type Message = MavMessage;
7252 const ID: u32 = 435u32;
7253 const NAME: &'static str = "AVAILABLE_MODES";
7254 const EXTRA_CRC: u8 = 134u8;
7255 const ENCODED_LEN: usize = 46usize;
7256 fn deser(
7257 _version: MavlinkVersion,
7258 __input: &[u8],
7259 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7260 let avail_len = __input.len();
7261 let mut payload_buf = [0; Self::ENCODED_LEN];
7262 let mut buf = if avail_len < Self::ENCODED_LEN {
7263 payload_buf[0..avail_len].copy_from_slice(__input);
7264 Bytes::new(&payload_buf)
7265 } else {
7266 Bytes::new(__input)
7267 };
7268 let mut __struct = Self::default();
7269 __struct.custom_mode = buf.get_u32_le();
7270 let tmp = buf.get_u32_le();
7271 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
7272 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
7273 flag_type: "MavModeProperty",
7274 value: tmp as u32,
7275 })?;
7276 __struct.number_modes = buf.get_u8();
7277 __struct.mode_index = buf.get_u8();
7278 let tmp = buf.get_u8();
7279 __struct.standard_mode =
7280 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7281 enum_type: "MavStandardMode",
7282 value: tmp as u32,
7283 })?;
7284 for v in &mut __struct.mode_name {
7285 let val = buf.get_u8();
7286 *v = val;
7287 }
7288 Ok(__struct)
7289 }
7290 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7291 let mut __tmp = BytesMut::new(bytes);
7292 #[allow(clippy::absurd_extreme_comparisons)]
7293 #[allow(unused_comparisons)]
7294 if __tmp.remaining() < Self::ENCODED_LEN {
7295 panic!(
7296 "buffer is too small (need {} bytes, but got {})",
7297 Self::ENCODED_LEN,
7298 __tmp.remaining(),
7299 )
7300 }
7301 __tmp.put_u32_le(self.custom_mode);
7302 __tmp.put_u32_le(self.properties.bits());
7303 __tmp.put_u8(self.number_modes);
7304 __tmp.put_u8(self.mode_index);
7305 __tmp.put_u8(self.standard_mode as u8);
7306 for val in &self.mode_name {
7307 __tmp.put_u8(*val);
7308 }
7309 if matches!(version, MavlinkVersion::V2) {
7310 let len = __tmp.len();
7311 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7312 } else {
7313 __tmp.len()
7314 }
7315 }
7316}
7317#[doc = "id: 259"]
7318#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7319#[derive(Debug, Clone, PartialEq)]
7320#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7321#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7322pub struct CAMERA_INFORMATION_DATA {
7323 #[doc = "Timestamp (time since system boot)."]
7324 pub time_boot_ms: u32,
7325 #[doc = "0xff). Use 0 if not known."]
7326 pub firmware_version: u32,
7327 #[doc = "Focal length. Use NaN if not known."]
7328 pub focal_length: f32,
7329 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7330 pub sensor_size_h: f32,
7331 #[doc = "Image sensor size vertical. Use NaN if not known."]
7332 pub sensor_size_v: f32,
7333 #[doc = "Bitmap of camera capability flags."]
7334 pub flags: CameraCapFlags,
7335 #[doc = "Horizontal image resolution. Use 0 if not known."]
7336 pub resolution_h: u16,
7337 #[doc = "Vertical image resolution. Use 0 if not known."]
7338 pub resolution_v: u16,
7339 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7340 pub cam_definition_version: u16,
7341 #[doc = "Name of the camera vendor"]
7342 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7343 pub vendor_name: [u8; 32],
7344 #[doc = "Name of the camera model"]
7345 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7346 pub model_name: [u8; 32],
7347 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7348 pub lens_id: u8,
7349 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7350 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7351 pub cam_definition_uri: [u8; 140],
7352 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7353 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7354 pub gimbal_device_id: u8,
7355 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7356 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7357 pub camera_device_id: u8,
7358}
7359impl CAMERA_INFORMATION_DATA {
7360 pub const ENCODED_LEN: usize = 237usize;
7361 pub const DEFAULT: Self = Self {
7362 time_boot_ms: 0_u32,
7363 firmware_version: 0_u32,
7364 focal_length: 0.0_f32,
7365 sensor_size_h: 0.0_f32,
7366 sensor_size_v: 0.0_f32,
7367 flags: CameraCapFlags::DEFAULT,
7368 resolution_h: 0_u16,
7369 resolution_v: 0_u16,
7370 cam_definition_version: 0_u16,
7371 vendor_name: [0_u8; 32usize],
7372 model_name: [0_u8; 32usize],
7373 lens_id: 0_u8,
7374 cam_definition_uri: [0_u8; 140usize],
7375 gimbal_device_id: 0_u8,
7376 camera_device_id: 0_u8,
7377 };
7378 #[cfg(feature = "arbitrary")]
7379 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7380 use arbitrary::{Arbitrary, Unstructured};
7381 let mut buf = [0u8; 1024];
7382 rng.fill_bytes(&mut buf);
7383 let mut unstructured = Unstructured::new(&buf);
7384 Self::arbitrary(&mut unstructured).unwrap_or_default()
7385 }
7386}
7387impl Default for CAMERA_INFORMATION_DATA {
7388 fn default() -> Self {
7389 Self::DEFAULT.clone()
7390 }
7391}
7392impl MessageData for CAMERA_INFORMATION_DATA {
7393 type Message = MavMessage;
7394 const ID: u32 = 259u32;
7395 const NAME: &'static str = "CAMERA_INFORMATION";
7396 const EXTRA_CRC: u8 = 92u8;
7397 const ENCODED_LEN: usize = 237usize;
7398 fn deser(
7399 _version: MavlinkVersion,
7400 __input: &[u8],
7401 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7402 let avail_len = __input.len();
7403 let mut payload_buf = [0; Self::ENCODED_LEN];
7404 let mut buf = if avail_len < Self::ENCODED_LEN {
7405 payload_buf[0..avail_len].copy_from_slice(__input);
7406 Bytes::new(&payload_buf)
7407 } else {
7408 Bytes::new(__input)
7409 };
7410 let mut __struct = Self::default();
7411 __struct.time_boot_ms = buf.get_u32_le();
7412 __struct.firmware_version = buf.get_u32_le();
7413 __struct.focal_length = buf.get_f32_le();
7414 __struct.sensor_size_h = buf.get_f32_le();
7415 __struct.sensor_size_v = buf.get_f32_le();
7416 let tmp = buf.get_u32_le();
7417 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7418 ::mavlink_core::error::ParserError::InvalidFlag {
7419 flag_type: "CameraCapFlags",
7420 value: tmp as u32,
7421 },
7422 )?;
7423 __struct.resolution_h = buf.get_u16_le();
7424 __struct.resolution_v = buf.get_u16_le();
7425 __struct.cam_definition_version = buf.get_u16_le();
7426 for v in &mut __struct.vendor_name {
7427 let val = buf.get_u8();
7428 *v = val;
7429 }
7430 for v in &mut __struct.model_name {
7431 let val = buf.get_u8();
7432 *v = val;
7433 }
7434 __struct.lens_id = buf.get_u8();
7435 for v in &mut __struct.cam_definition_uri {
7436 let val = buf.get_u8();
7437 *v = val;
7438 }
7439 __struct.gimbal_device_id = buf.get_u8();
7440 __struct.camera_device_id = buf.get_u8();
7441 Ok(__struct)
7442 }
7443 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7444 let mut __tmp = BytesMut::new(bytes);
7445 #[allow(clippy::absurd_extreme_comparisons)]
7446 #[allow(unused_comparisons)]
7447 if __tmp.remaining() < Self::ENCODED_LEN {
7448 panic!(
7449 "buffer is too small (need {} bytes, but got {})",
7450 Self::ENCODED_LEN,
7451 __tmp.remaining(),
7452 )
7453 }
7454 __tmp.put_u32_le(self.time_boot_ms);
7455 __tmp.put_u32_le(self.firmware_version);
7456 __tmp.put_f32_le(self.focal_length);
7457 __tmp.put_f32_le(self.sensor_size_h);
7458 __tmp.put_f32_le(self.sensor_size_v);
7459 __tmp.put_u32_le(self.flags.bits());
7460 __tmp.put_u16_le(self.resolution_h);
7461 __tmp.put_u16_le(self.resolution_v);
7462 __tmp.put_u16_le(self.cam_definition_version);
7463 for val in &self.vendor_name {
7464 __tmp.put_u8(*val);
7465 }
7466 for val in &self.model_name {
7467 __tmp.put_u8(*val);
7468 }
7469 __tmp.put_u8(self.lens_id);
7470 for val in &self.cam_definition_uri {
7471 __tmp.put_u8(*val);
7472 }
7473 __tmp.put_u8(self.gimbal_device_id);
7474 __tmp.put_u8(self.camera_device_id);
7475 if matches!(version, MavlinkVersion::V2) {
7476 let len = __tmp.len();
7477 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7478 } else {
7479 __tmp.len()
7480 }
7481 }
7482}
7483#[doc = "id: 140"]
7484#[doc = "Set the vehicle attitude and body angular rates."]
7485#[derive(Debug, Clone, PartialEq)]
7486#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7487#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7488pub struct ACTUATOR_CONTROL_TARGET_DATA {
7489 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7490 pub time_usec: u64,
7491 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
7492 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7493 pub controls: [f32; 8],
7494 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
7495 pub group_mlx: u8,
7496}
7497impl ACTUATOR_CONTROL_TARGET_DATA {
7498 pub const ENCODED_LEN: usize = 41usize;
7499 pub const DEFAULT: Self = Self {
7500 time_usec: 0_u64,
7501 controls: [0.0_f32; 8usize],
7502 group_mlx: 0_u8,
7503 };
7504 #[cfg(feature = "arbitrary")]
7505 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7506 use arbitrary::{Arbitrary, Unstructured};
7507 let mut buf = [0u8; 1024];
7508 rng.fill_bytes(&mut buf);
7509 let mut unstructured = Unstructured::new(&buf);
7510 Self::arbitrary(&mut unstructured).unwrap_or_default()
7511 }
7512}
7513impl Default for ACTUATOR_CONTROL_TARGET_DATA {
7514 fn default() -> Self {
7515 Self::DEFAULT.clone()
7516 }
7517}
7518impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
7519 type Message = MavMessage;
7520 const ID: u32 = 140u32;
7521 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
7522 const EXTRA_CRC: u8 = 181u8;
7523 const ENCODED_LEN: usize = 41usize;
7524 fn deser(
7525 _version: MavlinkVersion,
7526 __input: &[u8],
7527 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7528 let avail_len = __input.len();
7529 let mut payload_buf = [0; Self::ENCODED_LEN];
7530 let mut buf = if avail_len < Self::ENCODED_LEN {
7531 payload_buf[0..avail_len].copy_from_slice(__input);
7532 Bytes::new(&payload_buf)
7533 } else {
7534 Bytes::new(__input)
7535 };
7536 let mut __struct = Self::default();
7537 __struct.time_usec = buf.get_u64_le();
7538 for v in &mut __struct.controls {
7539 let val = buf.get_f32_le();
7540 *v = val;
7541 }
7542 __struct.group_mlx = buf.get_u8();
7543 Ok(__struct)
7544 }
7545 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7546 let mut __tmp = BytesMut::new(bytes);
7547 #[allow(clippy::absurd_extreme_comparisons)]
7548 #[allow(unused_comparisons)]
7549 if __tmp.remaining() < Self::ENCODED_LEN {
7550 panic!(
7551 "buffer is too small (need {} bytes, but got {})",
7552 Self::ENCODED_LEN,
7553 __tmp.remaining(),
7554 )
7555 }
7556 __tmp.put_u64_le(self.time_usec);
7557 for val in &self.controls {
7558 __tmp.put_f32_le(*val);
7559 }
7560 __tmp.put_u8(self.group_mlx);
7561 if matches!(version, MavlinkVersion::V2) {
7562 let len = __tmp.len();
7563 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7564 } else {
7565 __tmp.len()
7566 }
7567 }
7568}
7569#[doc = "id: 143"]
7570#[doc = "Barometer readings for 3rd barometer."]
7571#[derive(Debug, Clone, PartialEq)]
7572#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7573#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7574pub struct SCALED_PRESSURE3_DATA {
7575 #[doc = "Timestamp (time since system boot)."]
7576 pub time_boot_ms: u32,
7577 #[doc = "Absolute pressure"]
7578 pub press_abs: f32,
7579 #[doc = "Differential pressure"]
7580 pub press_diff: f32,
7581 #[doc = "Absolute pressure temperature"]
7582 pub temperature: i16,
7583 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
7584 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7585 pub temperature_press_diff: i16,
7586}
7587impl SCALED_PRESSURE3_DATA {
7588 pub const ENCODED_LEN: usize = 16usize;
7589 pub const DEFAULT: Self = Self {
7590 time_boot_ms: 0_u32,
7591 press_abs: 0.0_f32,
7592 press_diff: 0.0_f32,
7593 temperature: 0_i16,
7594 temperature_press_diff: 0_i16,
7595 };
7596 #[cfg(feature = "arbitrary")]
7597 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7598 use arbitrary::{Arbitrary, Unstructured};
7599 let mut buf = [0u8; 1024];
7600 rng.fill_bytes(&mut buf);
7601 let mut unstructured = Unstructured::new(&buf);
7602 Self::arbitrary(&mut unstructured).unwrap_or_default()
7603 }
7604}
7605impl Default for SCALED_PRESSURE3_DATA {
7606 fn default() -> Self {
7607 Self::DEFAULT.clone()
7608 }
7609}
7610impl MessageData for SCALED_PRESSURE3_DATA {
7611 type Message = MavMessage;
7612 const ID: u32 = 143u32;
7613 const NAME: &'static str = "SCALED_PRESSURE3";
7614 const EXTRA_CRC: u8 = 131u8;
7615 const ENCODED_LEN: usize = 16usize;
7616 fn deser(
7617 _version: MavlinkVersion,
7618 __input: &[u8],
7619 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7620 let avail_len = __input.len();
7621 let mut payload_buf = [0; Self::ENCODED_LEN];
7622 let mut buf = if avail_len < Self::ENCODED_LEN {
7623 payload_buf[0..avail_len].copy_from_slice(__input);
7624 Bytes::new(&payload_buf)
7625 } else {
7626 Bytes::new(__input)
7627 };
7628 let mut __struct = Self::default();
7629 __struct.time_boot_ms = buf.get_u32_le();
7630 __struct.press_abs = buf.get_f32_le();
7631 __struct.press_diff = buf.get_f32_le();
7632 __struct.temperature = buf.get_i16_le();
7633 __struct.temperature_press_diff = buf.get_i16_le();
7634 Ok(__struct)
7635 }
7636 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7637 let mut __tmp = BytesMut::new(bytes);
7638 #[allow(clippy::absurd_extreme_comparisons)]
7639 #[allow(unused_comparisons)]
7640 if __tmp.remaining() < Self::ENCODED_LEN {
7641 panic!(
7642 "buffer is too small (need {} bytes, but got {})",
7643 Self::ENCODED_LEN,
7644 __tmp.remaining(),
7645 )
7646 }
7647 __tmp.put_u32_le(self.time_boot_ms);
7648 __tmp.put_f32_le(self.press_abs);
7649 __tmp.put_f32_le(self.press_diff);
7650 __tmp.put_i16_le(self.temperature);
7651 __tmp.put_i16_le(self.temperature_press_diff);
7652 if matches!(version, MavlinkVersion::V2) {
7653 let len = __tmp.len();
7654 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7655 } else {
7656 __tmp.len()
7657 }
7658 }
7659}
7660#[doc = "id: 0"]
7661#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
7662#[derive(Debug, Clone, PartialEq)]
7663#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7664#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7665pub struct HEARTBEAT_DATA {
7666 #[doc = "A bitfield for use for autopilot-specific flags"]
7667 pub custom_mode: u32,
7668 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
7669 pub mavtype: MavType,
7670 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
7671 pub autopilot: MavAutopilot,
7672 #[doc = "System mode bitmap."]
7673 pub base_mode: MavModeFlag,
7674 #[doc = "System status flag."]
7675 pub system_status: MavState,
7676 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
7677 pub mavlink_version: u8,
7678}
7679impl HEARTBEAT_DATA {
7680 pub const ENCODED_LEN: usize = 9usize;
7681 pub const DEFAULT: Self = Self {
7682 custom_mode: 0_u32,
7683 mavtype: MavType::DEFAULT,
7684 autopilot: MavAutopilot::DEFAULT,
7685 base_mode: MavModeFlag::DEFAULT,
7686 system_status: MavState::DEFAULT,
7687 mavlink_version: 0_u8,
7688 };
7689 #[cfg(feature = "arbitrary")]
7690 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7691 use arbitrary::{Arbitrary, Unstructured};
7692 let mut buf = [0u8; 1024];
7693 rng.fill_bytes(&mut buf);
7694 let mut unstructured = Unstructured::new(&buf);
7695 Self::arbitrary(&mut unstructured).unwrap_or_default()
7696 }
7697}
7698impl Default for HEARTBEAT_DATA {
7699 fn default() -> Self {
7700 Self::DEFAULT.clone()
7701 }
7702}
7703impl MessageData for HEARTBEAT_DATA {
7704 type Message = MavMessage;
7705 const ID: u32 = 0u32;
7706 const NAME: &'static str = "HEARTBEAT";
7707 const EXTRA_CRC: u8 = 50u8;
7708 const ENCODED_LEN: usize = 9usize;
7709 fn deser(
7710 _version: MavlinkVersion,
7711 __input: &[u8],
7712 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7713 let avail_len = __input.len();
7714 let mut payload_buf = [0; Self::ENCODED_LEN];
7715 let mut buf = if avail_len < Self::ENCODED_LEN {
7716 payload_buf[0..avail_len].copy_from_slice(__input);
7717 Bytes::new(&payload_buf)
7718 } else {
7719 Bytes::new(__input)
7720 };
7721 let mut __struct = Self::default();
7722 __struct.custom_mode = buf.get_u32_le();
7723 let tmp = buf.get_u8();
7724 __struct.mavtype =
7725 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7726 enum_type: "MavType",
7727 value: tmp as u32,
7728 })?;
7729 let tmp = buf.get_u8();
7730 __struct.autopilot =
7731 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7732 enum_type: "MavAutopilot",
7733 value: tmp as u32,
7734 })?;
7735 let tmp = buf.get_u8();
7736 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
7737 ::mavlink_core::error::ParserError::InvalidFlag {
7738 flag_type: "MavModeFlag",
7739 value: tmp as u32,
7740 },
7741 )?;
7742 let tmp = buf.get_u8();
7743 __struct.system_status =
7744 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7745 enum_type: "MavState",
7746 value: tmp as u32,
7747 })?;
7748 __struct.mavlink_version = buf.get_u8();
7749 Ok(__struct)
7750 }
7751 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7752 let mut __tmp = BytesMut::new(bytes);
7753 #[allow(clippy::absurd_extreme_comparisons)]
7754 #[allow(unused_comparisons)]
7755 if __tmp.remaining() < Self::ENCODED_LEN {
7756 panic!(
7757 "buffer is too small (need {} bytes, but got {})",
7758 Self::ENCODED_LEN,
7759 __tmp.remaining(),
7760 )
7761 }
7762 __tmp.put_u32_le(self.custom_mode);
7763 __tmp.put_u8(self.mavtype as u8);
7764 __tmp.put_u8(self.autopilot as u8);
7765 __tmp.put_u8(self.base_mode.bits());
7766 __tmp.put_u8(self.system_status as u8);
7767 __tmp.put_u8(self.mavlink_version);
7768 if matches!(version, MavlinkVersion::V2) {
7769 let len = __tmp.len();
7770 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7771 } else {
7772 __tmp.len()
7773 }
7774 }
7775}
7776#[doc = "id: 64"]
7777#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
7778#[derive(Debug, Clone, PartialEq)]
7779#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7780#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7781pub struct LOCAL_POSITION_NED_COV_DATA {
7782 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
7783 pub time_usec: u64,
7784 #[doc = "X Position"]
7785 pub x: f32,
7786 #[doc = "Y Position"]
7787 pub y: f32,
7788 #[doc = "Z Position"]
7789 pub z: f32,
7790 #[doc = "X Speed"]
7791 pub vx: f32,
7792 #[doc = "Y Speed"]
7793 pub vy: f32,
7794 #[doc = "Z Speed"]
7795 pub vz: f32,
7796 #[doc = "X Acceleration"]
7797 pub ax: f32,
7798 #[doc = "Y Acceleration"]
7799 pub ay: f32,
7800 #[doc = "Z Acceleration"]
7801 pub az: f32,
7802 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
7803 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7804 pub covariance: [f32; 45],
7805 #[doc = "Class id of the estimator this estimate originated from."]
7806 pub estimator_type: MavEstimatorType,
7807}
7808impl LOCAL_POSITION_NED_COV_DATA {
7809 pub const ENCODED_LEN: usize = 225usize;
7810 pub const DEFAULT: Self = Self {
7811 time_usec: 0_u64,
7812 x: 0.0_f32,
7813 y: 0.0_f32,
7814 z: 0.0_f32,
7815 vx: 0.0_f32,
7816 vy: 0.0_f32,
7817 vz: 0.0_f32,
7818 ax: 0.0_f32,
7819 ay: 0.0_f32,
7820 az: 0.0_f32,
7821 covariance: [0.0_f32; 45usize],
7822 estimator_type: MavEstimatorType::DEFAULT,
7823 };
7824 #[cfg(feature = "arbitrary")]
7825 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7826 use arbitrary::{Arbitrary, Unstructured};
7827 let mut buf = [0u8; 1024];
7828 rng.fill_bytes(&mut buf);
7829 let mut unstructured = Unstructured::new(&buf);
7830 Self::arbitrary(&mut unstructured).unwrap_or_default()
7831 }
7832}
7833impl Default for LOCAL_POSITION_NED_COV_DATA {
7834 fn default() -> Self {
7835 Self::DEFAULT.clone()
7836 }
7837}
7838impl MessageData for LOCAL_POSITION_NED_COV_DATA {
7839 type Message = MavMessage;
7840 const ID: u32 = 64u32;
7841 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
7842 const EXTRA_CRC: u8 = 191u8;
7843 const ENCODED_LEN: usize = 225usize;
7844 fn deser(
7845 _version: MavlinkVersion,
7846 __input: &[u8],
7847 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7848 let avail_len = __input.len();
7849 let mut payload_buf = [0; Self::ENCODED_LEN];
7850 let mut buf = if avail_len < Self::ENCODED_LEN {
7851 payload_buf[0..avail_len].copy_from_slice(__input);
7852 Bytes::new(&payload_buf)
7853 } else {
7854 Bytes::new(__input)
7855 };
7856 let mut __struct = Self::default();
7857 __struct.time_usec = buf.get_u64_le();
7858 __struct.x = buf.get_f32_le();
7859 __struct.y = buf.get_f32_le();
7860 __struct.z = buf.get_f32_le();
7861 __struct.vx = buf.get_f32_le();
7862 __struct.vy = buf.get_f32_le();
7863 __struct.vz = buf.get_f32_le();
7864 __struct.ax = buf.get_f32_le();
7865 __struct.ay = buf.get_f32_le();
7866 __struct.az = buf.get_f32_le();
7867 for v in &mut __struct.covariance {
7868 let val = buf.get_f32_le();
7869 *v = val;
7870 }
7871 let tmp = buf.get_u8();
7872 __struct.estimator_type =
7873 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7874 enum_type: "MavEstimatorType",
7875 value: tmp as u32,
7876 })?;
7877 Ok(__struct)
7878 }
7879 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7880 let mut __tmp = BytesMut::new(bytes);
7881 #[allow(clippy::absurd_extreme_comparisons)]
7882 #[allow(unused_comparisons)]
7883 if __tmp.remaining() < Self::ENCODED_LEN {
7884 panic!(
7885 "buffer is too small (need {} bytes, but got {})",
7886 Self::ENCODED_LEN,
7887 __tmp.remaining(),
7888 )
7889 }
7890 __tmp.put_u64_le(self.time_usec);
7891 __tmp.put_f32_le(self.x);
7892 __tmp.put_f32_le(self.y);
7893 __tmp.put_f32_le(self.z);
7894 __tmp.put_f32_le(self.vx);
7895 __tmp.put_f32_le(self.vy);
7896 __tmp.put_f32_le(self.vz);
7897 __tmp.put_f32_le(self.ax);
7898 __tmp.put_f32_le(self.ay);
7899 __tmp.put_f32_le(self.az);
7900 for val in &self.covariance {
7901 __tmp.put_f32_le(*val);
7902 }
7903 __tmp.put_u8(self.estimator_type as u8);
7904 if matches!(version, MavlinkVersion::V2) {
7905 let len = __tmp.len();
7906 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7907 } else {
7908 __tmp.len()
7909 }
7910 }
7911}
7912#[doc = "id: 246"]
7913#[doc = "The location and information of an ADSB vehicle."]
7914#[derive(Debug, Clone, PartialEq)]
7915#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7916#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7917pub struct ADSB_VEHICLE_DATA {
7918 #[doc = "ICAO address"]
7919 pub ICAO_address: u32,
7920 #[doc = "Latitude"]
7921 pub lat: i32,
7922 #[doc = "Longitude"]
7923 pub lon: i32,
7924 #[doc = "Altitude(ASL)"]
7925 pub altitude: i32,
7926 #[doc = "Course over ground"]
7927 pub heading: u16,
7928 #[doc = "The horizontal velocity"]
7929 pub hor_velocity: u16,
7930 #[doc = "The vertical velocity. Positive is up"]
7931 pub ver_velocity: i16,
7932 #[doc = "Bitmap to indicate various statuses including valid data fields"]
7933 pub flags: AdsbFlags,
7934 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
7935 pub squawk: u16,
7936 #[doc = "ADSB altitude type."]
7937 pub altitude_type: AdsbAltitudeType,
7938 #[doc = "The callsign, 8+null"]
7939 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7940 pub callsign: [u8; 9],
7941 #[doc = "ADSB emitter type."]
7942 pub emitter_type: AdsbEmitterType,
7943 #[doc = "Time since last communication in seconds"]
7944 pub tslc: u8,
7945}
7946impl ADSB_VEHICLE_DATA {
7947 pub const ENCODED_LEN: usize = 38usize;
7948 pub const DEFAULT: Self = Self {
7949 ICAO_address: 0_u32,
7950 lat: 0_i32,
7951 lon: 0_i32,
7952 altitude: 0_i32,
7953 heading: 0_u16,
7954 hor_velocity: 0_u16,
7955 ver_velocity: 0_i16,
7956 flags: AdsbFlags::DEFAULT,
7957 squawk: 0_u16,
7958 altitude_type: AdsbAltitudeType::DEFAULT,
7959 callsign: [0_u8; 9usize],
7960 emitter_type: AdsbEmitterType::DEFAULT,
7961 tslc: 0_u8,
7962 };
7963 #[cfg(feature = "arbitrary")]
7964 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7965 use arbitrary::{Arbitrary, Unstructured};
7966 let mut buf = [0u8; 1024];
7967 rng.fill_bytes(&mut buf);
7968 let mut unstructured = Unstructured::new(&buf);
7969 Self::arbitrary(&mut unstructured).unwrap_or_default()
7970 }
7971}
7972impl Default for ADSB_VEHICLE_DATA {
7973 fn default() -> Self {
7974 Self::DEFAULT.clone()
7975 }
7976}
7977impl MessageData for ADSB_VEHICLE_DATA {
7978 type Message = MavMessage;
7979 const ID: u32 = 246u32;
7980 const NAME: &'static str = "ADSB_VEHICLE";
7981 const EXTRA_CRC: u8 = 184u8;
7982 const ENCODED_LEN: usize = 38usize;
7983 fn deser(
7984 _version: MavlinkVersion,
7985 __input: &[u8],
7986 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7987 let avail_len = __input.len();
7988 let mut payload_buf = [0; Self::ENCODED_LEN];
7989 let mut buf = if avail_len < Self::ENCODED_LEN {
7990 payload_buf[0..avail_len].copy_from_slice(__input);
7991 Bytes::new(&payload_buf)
7992 } else {
7993 Bytes::new(__input)
7994 };
7995 let mut __struct = Self::default();
7996 __struct.ICAO_address = buf.get_u32_le();
7997 __struct.lat = buf.get_i32_le();
7998 __struct.lon = buf.get_i32_le();
7999 __struct.altitude = buf.get_i32_le();
8000 __struct.heading = buf.get_u16_le();
8001 __struct.hor_velocity = buf.get_u16_le();
8002 __struct.ver_velocity = buf.get_i16_le();
8003 let tmp = buf.get_u16_le();
8004 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
8005 ::mavlink_core::error::ParserError::InvalidFlag {
8006 flag_type: "AdsbFlags",
8007 value: tmp as u32,
8008 },
8009 )?;
8010 __struct.squawk = buf.get_u16_le();
8011 let tmp = buf.get_u8();
8012 __struct.altitude_type =
8013 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8014 enum_type: "AdsbAltitudeType",
8015 value: tmp as u32,
8016 })?;
8017 for v in &mut __struct.callsign {
8018 let val = buf.get_u8();
8019 *v = val;
8020 }
8021 let tmp = buf.get_u8();
8022 __struct.emitter_type =
8023 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8024 enum_type: "AdsbEmitterType",
8025 value: tmp as u32,
8026 })?;
8027 __struct.tslc = buf.get_u8();
8028 Ok(__struct)
8029 }
8030 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8031 let mut __tmp = BytesMut::new(bytes);
8032 #[allow(clippy::absurd_extreme_comparisons)]
8033 #[allow(unused_comparisons)]
8034 if __tmp.remaining() < Self::ENCODED_LEN {
8035 panic!(
8036 "buffer is too small (need {} bytes, but got {})",
8037 Self::ENCODED_LEN,
8038 __tmp.remaining(),
8039 )
8040 }
8041 __tmp.put_u32_le(self.ICAO_address);
8042 __tmp.put_i32_le(self.lat);
8043 __tmp.put_i32_le(self.lon);
8044 __tmp.put_i32_le(self.altitude);
8045 __tmp.put_u16_le(self.heading);
8046 __tmp.put_u16_le(self.hor_velocity);
8047 __tmp.put_i16_le(self.ver_velocity);
8048 __tmp.put_u16_le(self.flags.bits());
8049 __tmp.put_u16_le(self.squawk);
8050 __tmp.put_u8(self.altitude_type as u8);
8051 for val in &self.callsign {
8052 __tmp.put_u8(*val);
8053 }
8054 __tmp.put_u8(self.emitter_type as u8);
8055 __tmp.put_u8(self.tslc);
8056 if matches!(version, MavlinkVersion::V2) {
8057 let len = __tmp.len();
8058 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8059 } else {
8060 __tmp.len()
8061 }
8062 }
8063}
8064#[doc = "id: 360"]
8065#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
8066#[derive(Debug, Clone, PartialEq)]
8067#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8068#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8069pub struct ORBIT_EXECUTION_STATUS_DATA {
8070 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8071 pub time_usec: u64,
8072 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
8073 pub radius: f32,
8074 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
8075 pub x: i32,
8076 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
8077 pub y: i32,
8078 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
8079 pub z: f32,
8080 #[doc = "The coordinate system of the fields: x, y, z."]
8081 pub frame: MavFrame,
8082}
8083impl ORBIT_EXECUTION_STATUS_DATA {
8084 pub const ENCODED_LEN: usize = 25usize;
8085 pub const DEFAULT: Self = Self {
8086 time_usec: 0_u64,
8087 radius: 0.0_f32,
8088 x: 0_i32,
8089 y: 0_i32,
8090 z: 0.0_f32,
8091 frame: MavFrame::DEFAULT,
8092 };
8093 #[cfg(feature = "arbitrary")]
8094 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8095 use arbitrary::{Arbitrary, Unstructured};
8096 let mut buf = [0u8; 1024];
8097 rng.fill_bytes(&mut buf);
8098 let mut unstructured = Unstructured::new(&buf);
8099 Self::arbitrary(&mut unstructured).unwrap_or_default()
8100 }
8101}
8102impl Default for ORBIT_EXECUTION_STATUS_DATA {
8103 fn default() -> Self {
8104 Self::DEFAULT.clone()
8105 }
8106}
8107impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
8108 type Message = MavMessage;
8109 const ID: u32 = 360u32;
8110 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
8111 const EXTRA_CRC: u8 = 11u8;
8112 const ENCODED_LEN: usize = 25usize;
8113 fn deser(
8114 _version: MavlinkVersion,
8115 __input: &[u8],
8116 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8117 let avail_len = __input.len();
8118 let mut payload_buf = [0; Self::ENCODED_LEN];
8119 let mut buf = if avail_len < Self::ENCODED_LEN {
8120 payload_buf[0..avail_len].copy_from_slice(__input);
8121 Bytes::new(&payload_buf)
8122 } else {
8123 Bytes::new(__input)
8124 };
8125 let mut __struct = Self::default();
8126 __struct.time_usec = buf.get_u64_le();
8127 __struct.radius = buf.get_f32_le();
8128 __struct.x = buf.get_i32_le();
8129 __struct.y = buf.get_i32_le();
8130 __struct.z = buf.get_f32_le();
8131 let tmp = buf.get_u8();
8132 __struct.frame =
8133 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8134 enum_type: "MavFrame",
8135 value: tmp as u32,
8136 })?;
8137 Ok(__struct)
8138 }
8139 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8140 let mut __tmp = BytesMut::new(bytes);
8141 #[allow(clippy::absurd_extreme_comparisons)]
8142 #[allow(unused_comparisons)]
8143 if __tmp.remaining() < Self::ENCODED_LEN {
8144 panic!(
8145 "buffer is too small (need {} bytes, but got {})",
8146 Self::ENCODED_LEN,
8147 __tmp.remaining(),
8148 )
8149 }
8150 __tmp.put_u64_le(self.time_usec);
8151 __tmp.put_f32_le(self.radius);
8152 __tmp.put_i32_le(self.x);
8153 __tmp.put_i32_le(self.y);
8154 __tmp.put_f32_le(self.z);
8155 __tmp.put_u8(self.frame as u8);
8156 if matches!(version, MavlinkVersion::V2) {
8157 let len = __tmp.len();
8158 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8159 } else {
8160 __tmp.len()
8161 }
8162 }
8163}
8164#[doc = "id: 73"]
8165#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
8166#[derive(Debug, Clone, PartialEq)]
8167#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8168#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8169pub struct MISSION_ITEM_INT_DATA {
8170 #[doc = "PARAM1, see MAV_CMD enum"]
8171 pub param1: f32,
8172 #[doc = "PARAM2, see MAV_CMD enum"]
8173 pub param2: f32,
8174 #[doc = "PARAM3, see MAV_CMD enum"]
8175 pub param3: f32,
8176 #[doc = "PARAM4, see MAV_CMD enum"]
8177 pub param4: f32,
8178 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
8179 pub x: i32,
8180 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
8181 pub y: i32,
8182 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
8183 pub z: f32,
8184 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
8185 pub seq: u16,
8186 #[doc = "The scheduled action for the waypoint."]
8187 pub command: MavCmd,
8188 #[doc = "System ID"]
8189 pub target_system: u8,
8190 #[doc = "Component ID"]
8191 pub target_component: u8,
8192 #[doc = "The coordinate system of the waypoint."]
8193 pub frame: MavFrame,
8194 #[doc = "false:0, true:1"]
8195 pub current: u8,
8196 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
8197 pub autocontinue: u8,
8198 #[doc = "Mission type."]
8199 #[cfg_attr(feature = "serde", serde(default))]
8200 pub mission_type: MavMissionType,
8201}
8202impl MISSION_ITEM_INT_DATA {
8203 pub const ENCODED_LEN: usize = 38usize;
8204 pub const DEFAULT: Self = Self {
8205 param1: 0.0_f32,
8206 param2: 0.0_f32,
8207 param3: 0.0_f32,
8208 param4: 0.0_f32,
8209 x: 0_i32,
8210 y: 0_i32,
8211 z: 0.0_f32,
8212 seq: 0_u16,
8213 command: MavCmd::DEFAULT,
8214 target_system: 0_u8,
8215 target_component: 0_u8,
8216 frame: MavFrame::DEFAULT,
8217 current: 0_u8,
8218 autocontinue: 0_u8,
8219 mission_type: MavMissionType::DEFAULT,
8220 };
8221 #[cfg(feature = "arbitrary")]
8222 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8223 use arbitrary::{Arbitrary, Unstructured};
8224 let mut buf = [0u8; 1024];
8225 rng.fill_bytes(&mut buf);
8226 let mut unstructured = Unstructured::new(&buf);
8227 Self::arbitrary(&mut unstructured).unwrap_or_default()
8228 }
8229}
8230impl Default for MISSION_ITEM_INT_DATA {
8231 fn default() -> Self {
8232 Self::DEFAULT.clone()
8233 }
8234}
8235impl MessageData for MISSION_ITEM_INT_DATA {
8236 type Message = MavMessage;
8237 const ID: u32 = 73u32;
8238 const NAME: &'static str = "MISSION_ITEM_INT";
8239 const EXTRA_CRC: u8 = 38u8;
8240 const ENCODED_LEN: usize = 38usize;
8241 fn deser(
8242 _version: MavlinkVersion,
8243 __input: &[u8],
8244 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8245 let avail_len = __input.len();
8246 let mut payload_buf = [0; Self::ENCODED_LEN];
8247 let mut buf = if avail_len < Self::ENCODED_LEN {
8248 payload_buf[0..avail_len].copy_from_slice(__input);
8249 Bytes::new(&payload_buf)
8250 } else {
8251 Bytes::new(__input)
8252 };
8253 let mut __struct = Self::default();
8254 __struct.param1 = buf.get_f32_le();
8255 __struct.param2 = buf.get_f32_le();
8256 __struct.param3 = buf.get_f32_le();
8257 __struct.param4 = buf.get_f32_le();
8258 __struct.x = buf.get_i32_le();
8259 __struct.y = buf.get_i32_le();
8260 __struct.z = buf.get_f32_le();
8261 __struct.seq = buf.get_u16_le();
8262 let tmp = buf.get_u16_le();
8263 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
8264 ::mavlink_core::error::ParserError::InvalidEnum {
8265 enum_type: "MavCmd",
8266 value: tmp as u32,
8267 },
8268 )?;
8269 __struct.target_system = buf.get_u8();
8270 __struct.target_component = buf.get_u8();
8271 let tmp = buf.get_u8();
8272 __struct.frame =
8273 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8274 enum_type: "MavFrame",
8275 value: tmp as u32,
8276 })?;
8277 __struct.current = buf.get_u8();
8278 __struct.autocontinue = buf.get_u8();
8279 let tmp = buf.get_u8();
8280 __struct.mission_type =
8281 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8282 enum_type: "MavMissionType",
8283 value: tmp as u32,
8284 })?;
8285 Ok(__struct)
8286 }
8287 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8288 let mut __tmp = BytesMut::new(bytes);
8289 #[allow(clippy::absurd_extreme_comparisons)]
8290 #[allow(unused_comparisons)]
8291 if __tmp.remaining() < Self::ENCODED_LEN {
8292 panic!(
8293 "buffer is too small (need {} bytes, but got {})",
8294 Self::ENCODED_LEN,
8295 __tmp.remaining(),
8296 )
8297 }
8298 __tmp.put_f32_le(self.param1);
8299 __tmp.put_f32_le(self.param2);
8300 __tmp.put_f32_le(self.param3);
8301 __tmp.put_f32_le(self.param4);
8302 __tmp.put_i32_le(self.x);
8303 __tmp.put_i32_le(self.y);
8304 __tmp.put_f32_le(self.z);
8305 __tmp.put_u16_le(self.seq);
8306 __tmp.put_u16_le(self.command as u16);
8307 __tmp.put_u8(self.target_system);
8308 __tmp.put_u8(self.target_component);
8309 __tmp.put_u8(self.frame as u8);
8310 __tmp.put_u8(self.current);
8311 __tmp.put_u8(self.autocontinue);
8312 __tmp.put_u8(self.mission_type as u8);
8313 if matches!(version, MavlinkVersion::V2) {
8314 let len = __tmp.len();
8315 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8316 } else {
8317 __tmp.len()
8318 }
8319 }
8320}
8321#[doc = "id: 135"]
8322#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
8323#[derive(Debug, Clone, PartialEq)]
8324#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8325#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8326pub struct TERRAIN_CHECK_DATA {
8327 #[doc = "Latitude"]
8328 pub lat: i32,
8329 #[doc = "Longitude"]
8330 pub lon: i32,
8331}
8332impl TERRAIN_CHECK_DATA {
8333 pub const ENCODED_LEN: usize = 8usize;
8334 pub const DEFAULT: Self = Self {
8335 lat: 0_i32,
8336 lon: 0_i32,
8337 };
8338 #[cfg(feature = "arbitrary")]
8339 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8340 use arbitrary::{Arbitrary, Unstructured};
8341 let mut buf = [0u8; 1024];
8342 rng.fill_bytes(&mut buf);
8343 let mut unstructured = Unstructured::new(&buf);
8344 Self::arbitrary(&mut unstructured).unwrap_or_default()
8345 }
8346}
8347impl Default for TERRAIN_CHECK_DATA {
8348 fn default() -> Self {
8349 Self::DEFAULT.clone()
8350 }
8351}
8352impl MessageData for TERRAIN_CHECK_DATA {
8353 type Message = MavMessage;
8354 const ID: u32 = 135u32;
8355 const NAME: &'static str = "TERRAIN_CHECK";
8356 const EXTRA_CRC: u8 = 203u8;
8357 const ENCODED_LEN: usize = 8usize;
8358 fn deser(
8359 _version: MavlinkVersion,
8360 __input: &[u8],
8361 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8362 let avail_len = __input.len();
8363 let mut payload_buf = [0; Self::ENCODED_LEN];
8364 let mut buf = if avail_len < Self::ENCODED_LEN {
8365 payload_buf[0..avail_len].copy_from_slice(__input);
8366 Bytes::new(&payload_buf)
8367 } else {
8368 Bytes::new(__input)
8369 };
8370 let mut __struct = Self::default();
8371 __struct.lat = buf.get_i32_le();
8372 __struct.lon = buf.get_i32_le();
8373 Ok(__struct)
8374 }
8375 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8376 let mut __tmp = BytesMut::new(bytes);
8377 #[allow(clippy::absurd_extreme_comparisons)]
8378 #[allow(unused_comparisons)]
8379 if __tmp.remaining() < Self::ENCODED_LEN {
8380 panic!(
8381 "buffer is too small (need {} bytes, but got {})",
8382 Self::ENCODED_LEN,
8383 __tmp.remaining(),
8384 )
8385 }
8386 __tmp.put_i32_le(self.lat);
8387 __tmp.put_i32_le(self.lon);
8388 if matches!(version, MavlinkVersion::V2) {
8389 let len = __tmp.len();
8390 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8391 } else {
8392 __tmp.len()
8393 }
8394 }
8395}
8396#[doc = "id: 410"]
8397#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
8398#[derive(Debug, Clone, PartialEq)]
8399#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8400#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8401pub struct EVENT_DATA {
8402 #[doc = "Event ID (as defined in the component metadata)"]
8403 pub id: u32,
8404 #[doc = "Timestamp (time since system boot when the event happened)."]
8405 pub event_time_boot_ms: u32,
8406 #[doc = "Sequence number."]
8407 pub sequence: u16,
8408 #[doc = "Component ID"]
8409 pub destination_component: u8,
8410 #[doc = "System ID"]
8411 pub destination_system: u8,
8412 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
8413 pub log_levels: u8,
8414 #[doc = "Arguments (depend on event ID)."]
8415 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8416 pub arguments: [u8; 40],
8417}
8418impl EVENT_DATA {
8419 pub const ENCODED_LEN: usize = 53usize;
8420 pub const DEFAULT: Self = Self {
8421 id: 0_u32,
8422 event_time_boot_ms: 0_u32,
8423 sequence: 0_u16,
8424 destination_component: 0_u8,
8425 destination_system: 0_u8,
8426 log_levels: 0_u8,
8427 arguments: [0_u8; 40usize],
8428 };
8429 #[cfg(feature = "arbitrary")]
8430 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8431 use arbitrary::{Arbitrary, Unstructured};
8432 let mut buf = [0u8; 1024];
8433 rng.fill_bytes(&mut buf);
8434 let mut unstructured = Unstructured::new(&buf);
8435 Self::arbitrary(&mut unstructured).unwrap_or_default()
8436 }
8437}
8438impl Default for EVENT_DATA {
8439 fn default() -> Self {
8440 Self::DEFAULT.clone()
8441 }
8442}
8443impl MessageData for EVENT_DATA {
8444 type Message = MavMessage;
8445 const ID: u32 = 410u32;
8446 const NAME: &'static str = "EVENT";
8447 const EXTRA_CRC: u8 = 160u8;
8448 const ENCODED_LEN: usize = 53usize;
8449 fn deser(
8450 _version: MavlinkVersion,
8451 __input: &[u8],
8452 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8453 let avail_len = __input.len();
8454 let mut payload_buf = [0; Self::ENCODED_LEN];
8455 let mut buf = if avail_len < Self::ENCODED_LEN {
8456 payload_buf[0..avail_len].copy_from_slice(__input);
8457 Bytes::new(&payload_buf)
8458 } else {
8459 Bytes::new(__input)
8460 };
8461 let mut __struct = Self::default();
8462 __struct.id = buf.get_u32_le();
8463 __struct.event_time_boot_ms = buf.get_u32_le();
8464 __struct.sequence = buf.get_u16_le();
8465 __struct.destination_component = buf.get_u8();
8466 __struct.destination_system = buf.get_u8();
8467 __struct.log_levels = buf.get_u8();
8468 for v in &mut __struct.arguments {
8469 let val = buf.get_u8();
8470 *v = val;
8471 }
8472 Ok(__struct)
8473 }
8474 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8475 let mut __tmp = BytesMut::new(bytes);
8476 #[allow(clippy::absurd_extreme_comparisons)]
8477 #[allow(unused_comparisons)]
8478 if __tmp.remaining() < Self::ENCODED_LEN {
8479 panic!(
8480 "buffer is too small (need {} bytes, but got {})",
8481 Self::ENCODED_LEN,
8482 __tmp.remaining(),
8483 )
8484 }
8485 __tmp.put_u32_le(self.id);
8486 __tmp.put_u32_le(self.event_time_boot_ms);
8487 __tmp.put_u16_le(self.sequence);
8488 __tmp.put_u8(self.destination_component);
8489 __tmp.put_u8(self.destination_system);
8490 __tmp.put_u8(self.log_levels);
8491 for val in &self.arguments {
8492 __tmp.put_u8(*val);
8493 }
8494 if matches!(version, MavlinkVersion::V2) {
8495 let len = __tmp.len();
8496 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8497 } else {
8498 __tmp.len()
8499 }
8500 }
8501}
8502#[doc = "id: 83"]
8503#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
8504#[derive(Debug, Clone, PartialEq)]
8505#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8507pub struct ATTITUDE_TARGET_DATA {
8508 #[doc = "Timestamp (time since system boot)."]
8509 pub time_boot_ms: u32,
8510 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
8511 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8512 pub q: [f32; 4],
8513 #[doc = "Body roll rate"]
8514 pub body_roll_rate: f32,
8515 #[doc = "Body pitch rate"]
8516 pub body_pitch_rate: f32,
8517 #[doc = "Body yaw rate"]
8518 pub body_yaw_rate: f32,
8519 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
8520 pub thrust: f32,
8521 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
8522 pub type_mask: AttitudeTargetTypemask,
8523}
8524impl ATTITUDE_TARGET_DATA {
8525 pub const ENCODED_LEN: usize = 37usize;
8526 pub const DEFAULT: Self = Self {
8527 time_boot_ms: 0_u32,
8528 q: [0.0_f32; 4usize],
8529 body_roll_rate: 0.0_f32,
8530 body_pitch_rate: 0.0_f32,
8531 body_yaw_rate: 0.0_f32,
8532 thrust: 0.0_f32,
8533 type_mask: AttitudeTargetTypemask::DEFAULT,
8534 };
8535 #[cfg(feature = "arbitrary")]
8536 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8537 use arbitrary::{Arbitrary, Unstructured};
8538 let mut buf = [0u8; 1024];
8539 rng.fill_bytes(&mut buf);
8540 let mut unstructured = Unstructured::new(&buf);
8541 Self::arbitrary(&mut unstructured).unwrap_or_default()
8542 }
8543}
8544impl Default for ATTITUDE_TARGET_DATA {
8545 fn default() -> Self {
8546 Self::DEFAULT.clone()
8547 }
8548}
8549impl MessageData for ATTITUDE_TARGET_DATA {
8550 type Message = MavMessage;
8551 const ID: u32 = 83u32;
8552 const NAME: &'static str = "ATTITUDE_TARGET";
8553 const EXTRA_CRC: u8 = 22u8;
8554 const ENCODED_LEN: usize = 37usize;
8555 fn deser(
8556 _version: MavlinkVersion,
8557 __input: &[u8],
8558 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8559 let avail_len = __input.len();
8560 let mut payload_buf = [0; Self::ENCODED_LEN];
8561 let mut buf = if avail_len < Self::ENCODED_LEN {
8562 payload_buf[0..avail_len].copy_from_slice(__input);
8563 Bytes::new(&payload_buf)
8564 } else {
8565 Bytes::new(__input)
8566 };
8567 let mut __struct = Self::default();
8568 __struct.time_boot_ms = buf.get_u32_le();
8569 for v in &mut __struct.q {
8570 let val = buf.get_f32_le();
8571 *v = val;
8572 }
8573 __struct.body_roll_rate = buf.get_f32_le();
8574 __struct.body_pitch_rate = buf.get_f32_le();
8575 __struct.body_yaw_rate = buf.get_f32_le();
8576 __struct.thrust = buf.get_f32_le();
8577 let tmp = buf.get_u8();
8578 __struct.type_mask = AttitudeTargetTypemask::from_bits(
8579 tmp & AttitudeTargetTypemask::all().bits(),
8580 )
8581 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8582 flag_type: "AttitudeTargetTypemask",
8583 value: tmp as u32,
8584 })?;
8585 Ok(__struct)
8586 }
8587 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8588 let mut __tmp = BytesMut::new(bytes);
8589 #[allow(clippy::absurd_extreme_comparisons)]
8590 #[allow(unused_comparisons)]
8591 if __tmp.remaining() < Self::ENCODED_LEN {
8592 panic!(
8593 "buffer is too small (need {} bytes, but got {})",
8594 Self::ENCODED_LEN,
8595 __tmp.remaining(),
8596 )
8597 }
8598 __tmp.put_u32_le(self.time_boot_ms);
8599 for val in &self.q {
8600 __tmp.put_f32_le(*val);
8601 }
8602 __tmp.put_f32_le(self.body_roll_rate);
8603 __tmp.put_f32_le(self.body_pitch_rate);
8604 __tmp.put_f32_le(self.body_yaw_rate);
8605 __tmp.put_f32_le(self.thrust);
8606 __tmp.put_u8(self.type_mask.bits());
8607 if matches!(version, MavlinkVersion::V2) {
8608 let len = __tmp.len();
8609 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8610 } else {
8611 __tmp.len()
8612 }
8613 }
8614}
8615#[doc = "id: 375"]
8616#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
8617#[derive(Debug, Clone, PartialEq)]
8618#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8619#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8620pub struct ACTUATOR_OUTPUT_STATUS_DATA {
8621 #[doc = "Timestamp (since system boot)."]
8622 pub time_usec: u64,
8623 #[doc = "Active outputs"]
8624 pub active: u32,
8625 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
8626 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8627 pub actuator: [f32; 32],
8628}
8629impl ACTUATOR_OUTPUT_STATUS_DATA {
8630 pub const ENCODED_LEN: usize = 140usize;
8631 pub const DEFAULT: Self = Self {
8632 time_usec: 0_u64,
8633 active: 0_u32,
8634 actuator: [0.0_f32; 32usize],
8635 };
8636 #[cfg(feature = "arbitrary")]
8637 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8638 use arbitrary::{Arbitrary, Unstructured};
8639 let mut buf = [0u8; 1024];
8640 rng.fill_bytes(&mut buf);
8641 let mut unstructured = Unstructured::new(&buf);
8642 Self::arbitrary(&mut unstructured).unwrap_or_default()
8643 }
8644}
8645impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
8646 fn default() -> Self {
8647 Self::DEFAULT.clone()
8648 }
8649}
8650impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
8651 type Message = MavMessage;
8652 const ID: u32 = 375u32;
8653 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
8654 const EXTRA_CRC: u8 = 251u8;
8655 const ENCODED_LEN: usize = 140usize;
8656 fn deser(
8657 _version: MavlinkVersion,
8658 __input: &[u8],
8659 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8660 let avail_len = __input.len();
8661 let mut payload_buf = [0; Self::ENCODED_LEN];
8662 let mut buf = if avail_len < Self::ENCODED_LEN {
8663 payload_buf[0..avail_len].copy_from_slice(__input);
8664 Bytes::new(&payload_buf)
8665 } else {
8666 Bytes::new(__input)
8667 };
8668 let mut __struct = Self::default();
8669 __struct.time_usec = buf.get_u64_le();
8670 __struct.active = buf.get_u32_le();
8671 for v in &mut __struct.actuator {
8672 let val = buf.get_f32_le();
8673 *v = val;
8674 }
8675 Ok(__struct)
8676 }
8677 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8678 let mut __tmp = BytesMut::new(bytes);
8679 #[allow(clippy::absurd_extreme_comparisons)]
8680 #[allow(unused_comparisons)]
8681 if __tmp.remaining() < Self::ENCODED_LEN {
8682 panic!(
8683 "buffer is too small (need {} bytes, but got {})",
8684 Self::ENCODED_LEN,
8685 __tmp.remaining(),
8686 )
8687 }
8688 __tmp.put_u64_le(self.time_usec);
8689 __tmp.put_u32_le(self.active);
8690 for val in &self.actuator {
8691 __tmp.put_f32_le(*val);
8692 }
8693 if matches!(version, MavlinkVersion::V2) {
8694 let len = __tmp.len();
8695 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8696 } else {
8697 __tmp.len()
8698 }
8699 }
8700}
8701#[doc = "id: 54"]
8702#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
8703#[derive(Debug, Clone, PartialEq)]
8704#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8705#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8706pub struct SAFETY_SET_ALLOWED_AREA_DATA {
8707 #[doc = "x position 1 / Latitude 1"]
8708 pub p1x: f32,
8709 #[doc = "y position 1 / Longitude 1"]
8710 pub p1y: f32,
8711 #[doc = "z position 1 / Altitude 1"]
8712 pub p1z: f32,
8713 #[doc = "x position 2 / Latitude 2"]
8714 pub p2x: f32,
8715 #[doc = "y position 2 / Longitude 2"]
8716 pub p2y: f32,
8717 #[doc = "z position 2 / Altitude 2"]
8718 pub p2z: f32,
8719 #[doc = "System ID"]
8720 pub target_system: u8,
8721 #[doc = "Component ID"]
8722 pub target_component: u8,
8723 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
8724 pub frame: MavFrame,
8725}
8726impl SAFETY_SET_ALLOWED_AREA_DATA {
8727 pub const ENCODED_LEN: usize = 27usize;
8728 pub const DEFAULT: Self = Self {
8729 p1x: 0.0_f32,
8730 p1y: 0.0_f32,
8731 p1z: 0.0_f32,
8732 p2x: 0.0_f32,
8733 p2y: 0.0_f32,
8734 p2z: 0.0_f32,
8735 target_system: 0_u8,
8736 target_component: 0_u8,
8737 frame: MavFrame::DEFAULT,
8738 };
8739 #[cfg(feature = "arbitrary")]
8740 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8741 use arbitrary::{Arbitrary, Unstructured};
8742 let mut buf = [0u8; 1024];
8743 rng.fill_bytes(&mut buf);
8744 let mut unstructured = Unstructured::new(&buf);
8745 Self::arbitrary(&mut unstructured).unwrap_or_default()
8746 }
8747}
8748impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
8749 fn default() -> Self {
8750 Self::DEFAULT.clone()
8751 }
8752}
8753impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
8754 type Message = MavMessage;
8755 const ID: u32 = 54u32;
8756 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
8757 const EXTRA_CRC: u8 = 15u8;
8758 const ENCODED_LEN: usize = 27usize;
8759 fn deser(
8760 _version: MavlinkVersion,
8761 __input: &[u8],
8762 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8763 let avail_len = __input.len();
8764 let mut payload_buf = [0; Self::ENCODED_LEN];
8765 let mut buf = if avail_len < Self::ENCODED_LEN {
8766 payload_buf[0..avail_len].copy_from_slice(__input);
8767 Bytes::new(&payload_buf)
8768 } else {
8769 Bytes::new(__input)
8770 };
8771 let mut __struct = Self::default();
8772 __struct.p1x = buf.get_f32_le();
8773 __struct.p1y = buf.get_f32_le();
8774 __struct.p1z = buf.get_f32_le();
8775 __struct.p2x = buf.get_f32_le();
8776 __struct.p2y = buf.get_f32_le();
8777 __struct.p2z = buf.get_f32_le();
8778 __struct.target_system = buf.get_u8();
8779 __struct.target_component = buf.get_u8();
8780 let tmp = buf.get_u8();
8781 __struct.frame =
8782 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8783 enum_type: "MavFrame",
8784 value: tmp as u32,
8785 })?;
8786 Ok(__struct)
8787 }
8788 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8789 let mut __tmp = BytesMut::new(bytes);
8790 #[allow(clippy::absurd_extreme_comparisons)]
8791 #[allow(unused_comparisons)]
8792 if __tmp.remaining() < Self::ENCODED_LEN {
8793 panic!(
8794 "buffer is too small (need {} bytes, but got {})",
8795 Self::ENCODED_LEN,
8796 __tmp.remaining(),
8797 )
8798 }
8799 __tmp.put_f32_le(self.p1x);
8800 __tmp.put_f32_le(self.p1y);
8801 __tmp.put_f32_le(self.p1z);
8802 __tmp.put_f32_le(self.p2x);
8803 __tmp.put_f32_le(self.p2y);
8804 __tmp.put_f32_le(self.p2z);
8805 __tmp.put_u8(self.target_system);
8806 __tmp.put_u8(self.target_component);
8807 __tmp.put_u8(self.frame as u8);
8808 if matches!(version, MavlinkVersion::V2) {
8809 let len = __tmp.len();
8810 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8811 } else {
8812 __tmp.len()
8813 }
8814 }
8815}
8816#[doc = "id: 144"]
8817#[doc = "Current motion information from a designated system."]
8818#[derive(Debug, Clone, PartialEq)]
8819#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8821pub struct FOLLOW_TARGET_DATA {
8822 #[doc = "Timestamp (time since system boot)."]
8823 pub timestamp: u64,
8824 #[doc = "button states or switches of a tracker device"]
8825 pub custom_state: u64,
8826 #[doc = "Latitude (WGS84)"]
8827 pub lat: i32,
8828 #[doc = "Longitude (WGS84)"]
8829 pub lon: i32,
8830 #[doc = "Altitude (MSL)"]
8831 pub alt: f32,
8832 #[doc = "target velocity (0,0,0) for unknown"]
8833 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8834 pub vel: [f32; 3],
8835 #[doc = "linear target acceleration (0,0,0) for unknown"]
8836 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8837 pub acc: [f32; 3],
8838 #[doc = "(0 0 0 0 for unknown)"]
8839 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8840 pub attitude_q: [f32; 4],
8841 #[doc = "(0 0 0 for unknown)"]
8842 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8843 pub rates: [f32; 3],
8844 #[doc = "eph epv"]
8845 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8846 pub position_cov: [f32; 3],
8847 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
8848 pub est_capabilities: u8,
8849}
8850impl FOLLOW_TARGET_DATA {
8851 pub const ENCODED_LEN: usize = 93usize;
8852 pub const DEFAULT: Self = Self {
8853 timestamp: 0_u64,
8854 custom_state: 0_u64,
8855 lat: 0_i32,
8856 lon: 0_i32,
8857 alt: 0.0_f32,
8858 vel: [0.0_f32; 3usize],
8859 acc: [0.0_f32; 3usize],
8860 attitude_q: [0.0_f32; 4usize],
8861 rates: [0.0_f32; 3usize],
8862 position_cov: [0.0_f32; 3usize],
8863 est_capabilities: 0_u8,
8864 };
8865 #[cfg(feature = "arbitrary")]
8866 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8867 use arbitrary::{Arbitrary, Unstructured};
8868 let mut buf = [0u8; 1024];
8869 rng.fill_bytes(&mut buf);
8870 let mut unstructured = Unstructured::new(&buf);
8871 Self::arbitrary(&mut unstructured).unwrap_or_default()
8872 }
8873}
8874impl Default for FOLLOW_TARGET_DATA {
8875 fn default() -> Self {
8876 Self::DEFAULT.clone()
8877 }
8878}
8879impl MessageData for FOLLOW_TARGET_DATA {
8880 type Message = MavMessage;
8881 const ID: u32 = 144u32;
8882 const NAME: &'static str = "FOLLOW_TARGET";
8883 const EXTRA_CRC: u8 = 127u8;
8884 const ENCODED_LEN: usize = 93usize;
8885 fn deser(
8886 _version: MavlinkVersion,
8887 __input: &[u8],
8888 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8889 let avail_len = __input.len();
8890 let mut payload_buf = [0; Self::ENCODED_LEN];
8891 let mut buf = if avail_len < Self::ENCODED_LEN {
8892 payload_buf[0..avail_len].copy_from_slice(__input);
8893 Bytes::new(&payload_buf)
8894 } else {
8895 Bytes::new(__input)
8896 };
8897 let mut __struct = Self::default();
8898 __struct.timestamp = buf.get_u64_le();
8899 __struct.custom_state = buf.get_u64_le();
8900 __struct.lat = buf.get_i32_le();
8901 __struct.lon = buf.get_i32_le();
8902 __struct.alt = buf.get_f32_le();
8903 for v in &mut __struct.vel {
8904 let val = buf.get_f32_le();
8905 *v = val;
8906 }
8907 for v in &mut __struct.acc {
8908 let val = buf.get_f32_le();
8909 *v = val;
8910 }
8911 for v in &mut __struct.attitude_q {
8912 let val = buf.get_f32_le();
8913 *v = val;
8914 }
8915 for v in &mut __struct.rates {
8916 let val = buf.get_f32_le();
8917 *v = val;
8918 }
8919 for v in &mut __struct.position_cov {
8920 let val = buf.get_f32_le();
8921 *v = val;
8922 }
8923 __struct.est_capabilities = buf.get_u8();
8924 Ok(__struct)
8925 }
8926 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8927 let mut __tmp = BytesMut::new(bytes);
8928 #[allow(clippy::absurd_extreme_comparisons)]
8929 #[allow(unused_comparisons)]
8930 if __tmp.remaining() < Self::ENCODED_LEN {
8931 panic!(
8932 "buffer is too small (need {} bytes, but got {})",
8933 Self::ENCODED_LEN,
8934 __tmp.remaining(),
8935 )
8936 }
8937 __tmp.put_u64_le(self.timestamp);
8938 __tmp.put_u64_le(self.custom_state);
8939 __tmp.put_i32_le(self.lat);
8940 __tmp.put_i32_le(self.lon);
8941 __tmp.put_f32_le(self.alt);
8942 for val in &self.vel {
8943 __tmp.put_f32_le(*val);
8944 }
8945 for val in &self.acc {
8946 __tmp.put_f32_le(*val);
8947 }
8948 for val in &self.attitude_q {
8949 __tmp.put_f32_le(*val);
8950 }
8951 for val in &self.rates {
8952 __tmp.put_f32_le(*val);
8953 }
8954 for val in &self.position_cov {
8955 __tmp.put_f32_le(*val);
8956 }
8957 __tmp.put_u8(self.est_capabilities);
8958 if matches!(version, MavlinkVersion::V2) {
8959 let len = __tmp.len();
8960 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8961 } else {
8962 __tmp.len()
8963 }
8964 }
8965}
8966#[doc = "id: 251"]
8967#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
8968#[derive(Debug, Clone, PartialEq)]
8969#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8970#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8971pub struct NAMED_VALUE_FLOAT_DATA {
8972 #[doc = "Timestamp (time since system boot)."]
8973 pub time_boot_ms: u32,
8974 #[doc = "Floating point value"]
8975 pub value: f32,
8976 #[doc = "Name of the debug variable"]
8977 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8978 pub name: [u8; 10],
8979}
8980impl NAMED_VALUE_FLOAT_DATA {
8981 pub const ENCODED_LEN: usize = 18usize;
8982 pub const DEFAULT: Self = Self {
8983 time_boot_ms: 0_u32,
8984 value: 0.0_f32,
8985 name: [0_u8; 10usize],
8986 };
8987 #[cfg(feature = "arbitrary")]
8988 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8989 use arbitrary::{Arbitrary, Unstructured};
8990 let mut buf = [0u8; 1024];
8991 rng.fill_bytes(&mut buf);
8992 let mut unstructured = Unstructured::new(&buf);
8993 Self::arbitrary(&mut unstructured).unwrap_or_default()
8994 }
8995}
8996impl Default for NAMED_VALUE_FLOAT_DATA {
8997 fn default() -> Self {
8998 Self::DEFAULT.clone()
8999 }
9000}
9001impl MessageData for NAMED_VALUE_FLOAT_DATA {
9002 type Message = MavMessage;
9003 const ID: u32 = 251u32;
9004 const NAME: &'static str = "NAMED_VALUE_FLOAT";
9005 const EXTRA_CRC: u8 = 170u8;
9006 const ENCODED_LEN: usize = 18usize;
9007 fn deser(
9008 _version: MavlinkVersion,
9009 __input: &[u8],
9010 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9011 let avail_len = __input.len();
9012 let mut payload_buf = [0; Self::ENCODED_LEN];
9013 let mut buf = if avail_len < Self::ENCODED_LEN {
9014 payload_buf[0..avail_len].copy_from_slice(__input);
9015 Bytes::new(&payload_buf)
9016 } else {
9017 Bytes::new(__input)
9018 };
9019 let mut __struct = Self::default();
9020 __struct.time_boot_ms = buf.get_u32_le();
9021 __struct.value = buf.get_f32_le();
9022 for v in &mut __struct.name {
9023 let val = buf.get_u8();
9024 *v = val;
9025 }
9026 Ok(__struct)
9027 }
9028 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9029 let mut __tmp = BytesMut::new(bytes);
9030 #[allow(clippy::absurd_extreme_comparisons)]
9031 #[allow(unused_comparisons)]
9032 if __tmp.remaining() < Self::ENCODED_LEN {
9033 panic!(
9034 "buffer is too small (need {} bytes, but got {})",
9035 Self::ENCODED_LEN,
9036 __tmp.remaining(),
9037 )
9038 }
9039 __tmp.put_u32_le(self.time_boot_ms);
9040 __tmp.put_f32_le(self.value);
9041 for val in &self.name {
9042 __tmp.put_u8(*val);
9043 }
9044 if matches!(version, MavlinkVersion::V2) {
9045 let len = __tmp.len();
9046 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9047 } else {
9048 __tmp.len()
9049 }
9050 }
9051}
9052#[doc = "id: 12901"]
9053#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
9054#[derive(Debug, Clone, PartialEq)]
9055#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9056#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9057pub struct OPEN_DRONE_ID_LOCATION_DATA {
9058 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
9059 pub latitude: i32,
9060 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
9061 pub longitude: i32,
9062 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
9063 pub altitude_barometric: f32,
9064 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
9065 pub altitude_geodetic: f32,
9066 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
9067 pub height: f32,
9068 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
9069 pub timestamp: f32,
9070 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
9071 pub direction: u16,
9072 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
9073 pub speed_horizontal: u16,
9074 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
9075 pub speed_vertical: i16,
9076 #[doc = "System ID (0 for broadcast)."]
9077 pub target_system: u8,
9078 #[doc = "Component ID (0 for broadcast)."]
9079 pub target_component: u8,
9080 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
9081 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9082 pub id_or_mac: [u8; 20],
9083 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
9084 pub status: MavOdidStatus,
9085 #[doc = "Indicates the reference point for the height field."]
9086 pub height_reference: MavOdidHeightRef,
9087 #[doc = "The accuracy of the horizontal position."]
9088 pub horizontal_accuracy: MavOdidHorAcc,
9089 #[doc = "The accuracy of the vertical position."]
9090 pub vertical_accuracy: MavOdidVerAcc,
9091 #[doc = "The accuracy of the barometric altitude."]
9092 pub barometer_accuracy: MavOdidVerAcc,
9093 #[doc = "The accuracy of the horizontal and vertical speed."]
9094 pub speed_accuracy: MavOdidSpeedAcc,
9095 #[doc = "The accuracy of the timestamps."]
9096 pub timestamp_accuracy: MavOdidTimeAcc,
9097}
9098impl OPEN_DRONE_ID_LOCATION_DATA {
9099 pub const ENCODED_LEN: usize = 59usize;
9100 pub const DEFAULT: Self = Self {
9101 latitude: 0_i32,
9102 longitude: 0_i32,
9103 altitude_barometric: 0.0_f32,
9104 altitude_geodetic: 0.0_f32,
9105 height: 0.0_f32,
9106 timestamp: 0.0_f32,
9107 direction: 0_u16,
9108 speed_horizontal: 0_u16,
9109 speed_vertical: 0_i16,
9110 target_system: 0_u8,
9111 target_component: 0_u8,
9112 id_or_mac: [0_u8; 20usize],
9113 status: MavOdidStatus::DEFAULT,
9114 height_reference: MavOdidHeightRef::DEFAULT,
9115 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
9116 vertical_accuracy: MavOdidVerAcc::DEFAULT,
9117 barometer_accuracy: MavOdidVerAcc::DEFAULT,
9118 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
9119 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
9120 };
9121 #[cfg(feature = "arbitrary")]
9122 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9123 use arbitrary::{Arbitrary, Unstructured};
9124 let mut buf = [0u8; 1024];
9125 rng.fill_bytes(&mut buf);
9126 let mut unstructured = Unstructured::new(&buf);
9127 Self::arbitrary(&mut unstructured).unwrap_or_default()
9128 }
9129}
9130impl Default for OPEN_DRONE_ID_LOCATION_DATA {
9131 fn default() -> Self {
9132 Self::DEFAULT.clone()
9133 }
9134}
9135impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
9136 type Message = MavMessage;
9137 const ID: u32 = 12901u32;
9138 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
9139 const EXTRA_CRC: u8 = 254u8;
9140 const ENCODED_LEN: usize = 59usize;
9141 fn deser(
9142 _version: MavlinkVersion,
9143 __input: &[u8],
9144 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9145 let avail_len = __input.len();
9146 let mut payload_buf = [0; Self::ENCODED_LEN];
9147 let mut buf = if avail_len < Self::ENCODED_LEN {
9148 payload_buf[0..avail_len].copy_from_slice(__input);
9149 Bytes::new(&payload_buf)
9150 } else {
9151 Bytes::new(__input)
9152 };
9153 let mut __struct = Self::default();
9154 __struct.latitude = buf.get_i32_le();
9155 __struct.longitude = buf.get_i32_le();
9156 __struct.altitude_barometric = buf.get_f32_le();
9157 __struct.altitude_geodetic = buf.get_f32_le();
9158 __struct.height = buf.get_f32_le();
9159 __struct.timestamp = buf.get_f32_le();
9160 __struct.direction = buf.get_u16_le();
9161 __struct.speed_horizontal = buf.get_u16_le();
9162 __struct.speed_vertical = buf.get_i16_le();
9163 __struct.target_system = buf.get_u8();
9164 __struct.target_component = buf.get_u8();
9165 for v in &mut __struct.id_or_mac {
9166 let val = buf.get_u8();
9167 *v = val;
9168 }
9169 let tmp = buf.get_u8();
9170 __struct.status =
9171 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9172 enum_type: "MavOdidStatus",
9173 value: tmp as u32,
9174 })?;
9175 let tmp = buf.get_u8();
9176 __struct.height_reference =
9177 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9178 enum_type: "MavOdidHeightRef",
9179 value: tmp as u32,
9180 })?;
9181 let tmp = buf.get_u8();
9182 __struct.horizontal_accuracy =
9183 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9184 enum_type: "MavOdidHorAcc",
9185 value: tmp as u32,
9186 })?;
9187 let tmp = buf.get_u8();
9188 __struct.vertical_accuracy =
9189 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9190 enum_type: "MavOdidVerAcc",
9191 value: tmp as u32,
9192 })?;
9193 let tmp = buf.get_u8();
9194 __struct.barometer_accuracy =
9195 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9196 enum_type: "MavOdidVerAcc",
9197 value: tmp as u32,
9198 })?;
9199 let tmp = buf.get_u8();
9200 __struct.speed_accuracy =
9201 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9202 enum_type: "MavOdidSpeedAcc",
9203 value: tmp as u32,
9204 })?;
9205 let tmp = buf.get_u8();
9206 __struct.timestamp_accuracy =
9207 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9208 enum_type: "MavOdidTimeAcc",
9209 value: tmp as u32,
9210 })?;
9211 Ok(__struct)
9212 }
9213 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9214 let mut __tmp = BytesMut::new(bytes);
9215 #[allow(clippy::absurd_extreme_comparisons)]
9216 #[allow(unused_comparisons)]
9217 if __tmp.remaining() < Self::ENCODED_LEN {
9218 panic!(
9219 "buffer is too small (need {} bytes, but got {})",
9220 Self::ENCODED_LEN,
9221 __tmp.remaining(),
9222 )
9223 }
9224 __tmp.put_i32_le(self.latitude);
9225 __tmp.put_i32_le(self.longitude);
9226 __tmp.put_f32_le(self.altitude_barometric);
9227 __tmp.put_f32_le(self.altitude_geodetic);
9228 __tmp.put_f32_le(self.height);
9229 __tmp.put_f32_le(self.timestamp);
9230 __tmp.put_u16_le(self.direction);
9231 __tmp.put_u16_le(self.speed_horizontal);
9232 __tmp.put_i16_le(self.speed_vertical);
9233 __tmp.put_u8(self.target_system);
9234 __tmp.put_u8(self.target_component);
9235 for val in &self.id_or_mac {
9236 __tmp.put_u8(*val);
9237 }
9238 __tmp.put_u8(self.status as u8);
9239 __tmp.put_u8(self.height_reference as u8);
9240 __tmp.put_u8(self.horizontal_accuracy as u8);
9241 __tmp.put_u8(self.vertical_accuracy as u8);
9242 __tmp.put_u8(self.barometer_accuracy as u8);
9243 __tmp.put_u8(self.speed_accuracy as u8);
9244 __tmp.put_u8(self.timestamp_accuracy as u8);
9245 if matches!(version, MavlinkVersion::V2) {
9246 let len = __tmp.len();
9247 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9248 } else {
9249 __tmp.len()
9250 }
9251 }
9252}
9253#[doc = "id: 253"]
9254#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
9255#[derive(Debug, Clone, PartialEq)]
9256#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9258pub struct STATUSTEXT_DATA {
9259 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
9260 pub severity: MavSeverity,
9261 #[doc = "Status text message, without null termination character"]
9262 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9263 pub text: [u8; 50],
9264 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
9265 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9266 pub id: u16,
9267 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
9268 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9269 pub chunk_seq: u8,
9270}
9271impl STATUSTEXT_DATA {
9272 pub const ENCODED_LEN: usize = 54usize;
9273 pub const DEFAULT: Self = Self {
9274 severity: MavSeverity::DEFAULT,
9275 text: [0_u8; 50usize],
9276 id: 0_u16,
9277 chunk_seq: 0_u8,
9278 };
9279 #[cfg(feature = "arbitrary")]
9280 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9281 use arbitrary::{Arbitrary, Unstructured};
9282 let mut buf = [0u8; 1024];
9283 rng.fill_bytes(&mut buf);
9284 let mut unstructured = Unstructured::new(&buf);
9285 Self::arbitrary(&mut unstructured).unwrap_or_default()
9286 }
9287}
9288impl Default for STATUSTEXT_DATA {
9289 fn default() -> Self {
9290 Self::DEFAULT.clone()
9291 }
9292}
9293impl MessageData for STATUSTEXT_DATA {
9294 type Message = MavMessage;
9295 const ID: u32 = 253u32;
9296 const NAME: &'static str = "STATUSTEXT";
9297 const EXTRA_CRC: u8 = 83u8;
9298 const ENCODED_LEN: usize = 54usize;
9299 fn deser(
9300 _version: MavlinkVersion,
9301 __input: &[u8],
9302 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9303 let avail_len = __input.len();
9304 let mut payload_buf = [0; Self::ENCODED_LEN];
9305 let mut buf = if avail_len < Self::ENCODED_LEN {
9306 payload_buf[0..avail_len].copy_from_slice(__input);
9307 Bytes::new(&payload_buf)
9308 } else {
9309 Bytes::new(__input)
9310 };
9311 let mut __struct = Self::default();
9312 let tmp = buf.get_u8();
9313 __struct.severity =
9314 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9315 enum_type: "MavSeverity",
9316 value: tmp as u32,
9317 })?;
9318 for v in &mut __struct.text {
9319 let val = buf.get_u8();
9320 *v = val;
9321 }
9322 __struct.id = buf.get_u16_le();
9323 __struct.chunk_seq = buf.get_u8();
9324 Ok(__struct)
9325 }
9326 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9327 let mut __tmp = BytesMut::new(bytes);
9328 #[allow(clippy::absurd_extreme_comparisons)]
9329 #[allow(unused_comparisons)]
9330 if __tmp.remaining() < Self::ENCODED_LEN {
9331 panic!(
9332 "buffer is too small (need {} bytes, but got {})",
9333 Self::ENCODED_LEN,
9334 __tmp.remaining(),
9335 )
9336 }
9337 __tmp.put_u8(self.severity as u8);
9338 for val in &self.text {
9339 __tmp.put_u8(*val);
9340 }
9341 __tmp.put_u16_le(self.id);
9342 __tmp.put_u8(self.chunk_seq);
9343 if matches!(version, MavlinkVersion::V2) {
9344 let len = __tmp.len();
9345 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9346 } else {
9347 __tmp.len()
9348 }
9349 }
9350}
9351#[doc = "id: 12903"]
9352#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
9353#[derive(Debug, Clone, PartialEq)]
9354#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9355#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9356pub struct OPEN_DRONE_ID_SELF_ID_DATA {
9357 #[doc = "System ID (0 for broadcast)."]
9358 pub target_system: u8,
9359 #[doc = "Component ID (0 for broadcast)."]
9360 pub target_component: u8,
9361 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
9362 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9363 pub id_or_mac: [u8; 20],
9364 #[doc = "Indicates the type of the description field."]
9365 pub description_type: MavOdidDescType,
9366 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
9367 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9368 pub description: [u8; 23],
9369}
9370impl OPEN_DRONE_ID_SELF_ID_DATA {
9371 pub const ENCODED_LEN: usize = 46usize;
9372 pub const DEFAULT: Self = Self {
9373 target_system: 0_u8,
9374 target_component: 0_u8,
9375 id_or_mac: [0_u8; 20usize],
9376 description_type: MavOdidDescType::DEFAULT,
9377 description: [0_u8; 23usize],
9378 };
9379 #[cfg(feature = "arbitrary")]
9380 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9381 use arbitrary::{Arbitrary, Unstructured};
9382 let mut buf = [0u8; 1024];
9383 rng.fill_bytes(&mut buf);
9384 let mut unstructured = Unstructured::new(&buf);
9385 Self::arbitrary(&mut unstructured).unwrap_or_default()
9386 }
9387}
9388impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
9389 fn default() -> Self {
9390 Self::DEFAULT.clone()
9391 }
9392}
9393impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
9394 type Message = MavMessage;
9395 const ID: u32 = 12903u32;
9396 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
9397 const EXTRA_CRC: u8 = 249u8;
9398 const ENCODED_LEN: usize = 46usize;
9399 fn deser(
9400 _version: MavlinkVersion,
9401 __input: &[u8],
9402 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9403 let avail_len = __input.len();
9404 let mut payload_buf = [0; Self::ENCODED_LEN];
9405 let mut buf = if avail_len < Self::ENCODED_LEN {
9406 payload_buf[0..avail_len].copy_from_slice(__input);
9407 Bytes::new(&payload_buf)
9408 } else {
9409 Bytes::new(__input)
9410 };
9411 let mut __struct = Self::default();
9412 __struct.target_system = buf.get_u8();
9413 __struct.target_component = buf.get_u8();
9414 for v in &mut __struct.id_or_mac {
9415 let val = buf.get_u8();
9416 *v = val;
9417 }
9418 let tmp = buf.get_u8();
9419 __struct.description_type =
9420 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9421 enum_type: "MavOdidDescType",
9422 value: tmp as u32,
9423 })?;
9424 for v in &mut __struct.description {
9425 let val = buf.get_u8();
9426 *v = val;
9427 }
9428 Ok(__struct)
9429 }
9430 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9431 let mut __tmp = BytesMut::new(bytes);
9432 #[allow(clippy::absurd_extreme_comparisons)]
9433 #[allow(unused_comparisons)]
9434 if __tmp.remaining() < Self::ENCODED_LEN {
9435 panic!(
9436 "buffer is too small (need {} bytes, but got {})",
9437 Self::ENCODED_LEN,
9438 __tmp.remaining(),
9439 )
9440 }
9441 __tmp.put_u8(self.target_system);
9442 __tmp.put_u8(self.target_component);
9443 for val in &self.id_or_mac {
9444 __tmp.put_u8(*val);
9445 }
9446 __tmp.put_u8(self.description_type as u8);
9447 for val in &self.description {
9448 __tmp.put_u8(*val);
9449 }
9450 if matches!(version, MavlinkVersion::V2) {
9451 let len = __tmp.len();
9452 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9453 } else {
9454 __tmp.len()
9455 }
9456 }
9457}
9458#[doc = "id: 258"]
9459#[doc = "Control vehicle tone generation (buzzer)."]
9460#[derive(Debug, Clone, PartialEq)]
9461#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9462#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9463pub struct PLAY_TUNE_DATA {
9464 #[doc = "System ID"]
9465 pub target_system: u8,
9466 #[doc = "Component ID"]
9467 pub target_component: u8,
9468 #[doc = "tune in board specific format"]
9469 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9470 pub tune: [u8; 30],
9471 #[doc = "tune extension (appended to tune)"]
9472 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9473 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9474 pub tune2: [u8; 200],
9475}
9476impl PLAY_TUNE_DATA {
9477 pub const ENCODED_LEN: usize = 232usize;
9478 pub const DEFAULT: Self = Self {
9479 target_system: 0_u8,
9480 target_component: 0_u8,
9481 tune: [0_u8; 30usize],
9482 tune2: [0_u8; 200usize],
9483 };
9484 #[cfg(feature = "arbitrary")]
9485 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9486 use arbitrary::{Arbitrary, Unstructured};
9487 let mut buf = [0u8; 1024];
9488 rng.fill_bytes(&mut buf);
9489 let mut unstructured = Unstructured::new(&buf);
9490 Self::arbitrary(&mut unstructured).unwrap_or_default()
9491 }
9492}
9493impl Default for PLAY_TUNE_DATA {
9494 fn default() -> Self {
9495 Self::DEFAULT.clone()
9496 }
9497}
9498impl MessageData for PLAY_TUNE_DATA {
9499 type Message = MavMessage;
9500 const ID: u32 = 258u32;
9501 const NAME: &'static str = "PLAY_TUNE";
9502 const EXTRA_CRC: u8 = 187u8;
9503 const ENCODED_LEN: usize = 232usize;
9504 fn deser(
9505 _version: MavlinkVersion,
9506 __input: &[u8],
9507 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9508 let avail_len = __input.len();
9509 let mut payload_buf = [0; Self::ENCODED_LEN];
9510 let mut buf = if avail_len < Self::ENCODED_LEN {
9511 payload_buf[0..avail_len].copy_from_slice(__input);
9512 Bytes::new(&payload_buf)
9513 } else {
9514 Bytes::new(__input)
9515 };
9516 let mut __struct = Self::default();
9517 __struct.target_system = buf.get_u8();
9518 __struct.target_component = buf.get_u8();
9519 for v in &mut __struct.tune {
9520 let val = buf.get_u8();
9521 *v = val;
9522 }
9523 for v in &mut __struct.tune2 {
9524 let val = buf.get_u8();
9525 *v = val;
9526 }
9527 Ok(__struct)
9528 }
9529 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9530 let mut __tmp = BytesMut::new(bytes);
9531 #[allow(clippy::absurd_extreme_comparisons)]
9532 #[allow(unused_comparisons)]
9533 if __tmp.remaining() < Self::ENCODED_LEN {
9534 panic!(
9535 "buffer is too small (need {} bytes, but got {})",
9536 Self::ENCODED_LEN,
9537 __tmp.remaining(),
9538 )
9539 }
9540 __tmp.put_u8(self.target_system);
9541 __tmp.put_u8(self.target_component);
9542 for val in &self.tune {
9543 __tmp.put_u8(*val);
9544 }
9545 for val in &self.tune2 {
9546 __tmp.put_u8(*val);
9547 }
9548 if matches!(version, MavlinkVersion::V2) {
9549 let len = __tmp.len();
9550 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9551 } else {
9552 __tmp.len()
9553 }
9554 }
9555}
9556#[doc = "id: 249"]
9557#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
9558#[derive(Debug, Clone, PartialEq)]
9559#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9560#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9561pub struct MEMORY_VECT_DATA {
9562 #[doc = "Starting address of the debug variables"]
9563 pub address: u16,
9564 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
9565 pub ver: u8,
9566 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
9567 pub mavtype: u8,
9568 #[doc = "Memory contents at specified address"]
9569 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9570 pub value: [i8; 32],
9571}
9572impl MEMORY_VECT_DATA {
9573 pub const ENCODED_LEN: usize = 36usize;
9574 pub const DEFAULT: Self = Self {
9575 address: 0_u16,
9576 ver: 0_u8,
9577 mavtype: 0_u8,
9578 value: [0_i8; 32usize],
9579 };
9580 #[cfg(feature = "arbitrary")]
9581 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9582 use arbitrary::{Arbitrary, Unstructured};
9583 let mut buf = [0u8; 1024];
9584 rng.fill_bytes(&mut buf);
9585 let mut unstructured = Unstructured::new(&buf);
9586 Self::arbitrary(&mut unstructured).unwrap_or_default()
9587 }
9588}
9589impl Default for MEMORY_VECT_DATA {
9590 fn default() -> Self {
9591 Self::DEFAULT.clone()
9592 }
9593}
9594impl MessageData for MEMORY_VECT_DATA {
9595 type Message = MavMessage;
9596 const ID: u32 = 249u32;
9597 const NAME: &'static str = "MEMORY_VECT";
9598 const EXTRA_CRC: u8 = 204u8;
9599 const ENCODED_LEN: usize = 36usize;
9600 fn deser(
9601 _version: MavlinkVersion,
9602 __input: &[u8],
9603 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9604 let avail_len = __input.len();
9605 let mut payload_buf = [0; Self::ENCODED_LEN];
9606 let mut buf = if avail_len < Self::ENCODED_LEN {
9607 payload_buf[0..avail_len].copy_from_slice(__input);
9608 Bytes::new(&payload_buf)
9609 } else {
9610 Bytes::new(__input)
9611 };
9612 let mut __struct = Self::default();
9613 __struct.address = buf.get_u16_le();
9614 __struct.ver = buf.get_u8();
9615 __struct.mavtype = buf.get_u8();
9616 for v in &mut __struct.value {
9617 let val = buf.get_i8();
9618 *v = val;
9619 }
9620 Ok(__struct)
9621 }
9622 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9623 let mut __tmp = BytesMut::new(bytes);
9624 #[allow(clippy::absurd_extreme_comparisons)]
9625 #[allow(unused_comparisons)]
9626 if __tmp.remaining() < Self::ENCODED_LEN {
9627 panic!(
9628 "buffer is too small (need {} bytes, but got {})",
9629 Self::ENCODED_LEN,
9630 __tmp.remaining(),
9631 )
9632 }
9633 __tmp.put_u16_le(self.address);
9634 __tmp.put_u8(self.ver);
9635 __tmp.put_u8(self.mavtype);
9636 for val in &self.value {
9637 __tmp.put_i8(*val);
9638 }
9639 if matches!(version, MavlinkVersion::V2) {
9640 let len = __tmp.len();
9641 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9642 } else {
9643 __tmp.len()
9644 }
9645 }
9646}
9647#[doc = "id: 380"]
9648#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
9649#[derive(Debug, Clone, PartialEq)]
9650#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9651#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9652pub struct TIME_ESTIMATE_TO_TARGET_DATA {
9653 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
9654 pub safe_return: i32,
9655 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
9656 pub land: i32,
9657 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
9658 pub mission_next_item: i32,
9659 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
9660 pub mission_end: i32,
9661 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
9662 pub commanded_action: i32,
9663}
9664impl TIME_ESTIMATE_TO_TARGET_DATA {
9665 pub const ENCODED_LEN: usize = 20usize;
9666 pub const DEFAULT: Self = Self {
9667 safe_return: 0_i32,
9668 land: 0_i32,
9669 mission_next_item: 0_i32,
9670 mission_end: 0_i32,
9671 commanded_action: 0_i32,
9672 };
9673 #[cfg(feature = "arbitrary")]
9674 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9675 use arbitrary::{Arbitrary, Unstructured};
9676 let mut buf = [0u8; 1024];
9677 rng.fill_bytes(&mut buf);
9678 let mut unstructured = Unstructured::new(&buf);
9679 Self::arbitrary(&mut unstructured).unwrap_or_default()
9680 }
9681}
9682impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
9683 fn default() -> Self {
9684 Self::DEFAULT.clone()
9685 }
9686}
9687impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
9688 type Message = MavMessage;
9689 const ID: u32 = 380u32;
9690 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
9691 const EXTRA_CRC: u8 = 232u8;
9692 const ENCODED_LEN: usize = 20usize;
9693 fn deser(
9694 _version: MavlinkVersion,
9695 __input: &[u8],
9696 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9697 let avail_len = __input.len();
9698 let mut payload_buf = [0; Self::ENCODED_LEN];
9699 let mut buf = if avail_len < Self::ENCODED_LEN {
9700 payload_buf[0..avail_len].copy_from_slice(__input);
9701 Bytes::new(&payload_buf)
9702 } else {
9703 Bytes::new(__input)
9704 };
9705 let mut __struct = Self::default();
9706 __struct.safe_return = buf.get_i32_le();
9707 __struct.land = buf.get_i32_le();
9708 __struct.mission_next_item = buf.get_i32_le();
9709 __struct.mission_end = buf.get_i32_le();
9710 __struct.commanded_action = buf.get_i32_le();
9711 Ok(__struct)
9712 }
9713 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9714 let mut __tmp = BytesMut::new(bytes);
9715 #[allow(clippy::absurd_extreme_comparisons)]
9716 #[allow(unused_comparisons)]
9717 if __tmp.remaining() < Self::ENCODED_LEN {
9718 panic!(
9719 "buffer is too small (need {} bytes, but got {})",
9720 Self::ENCODED_LEN,
9721 __tmp.remaining(),
9722 )
9723 }
9724 __tmp.put_i32_le(self.safe_return);
9725 __tmp.put_i32_le(self.land);
9726 __tmp.put_i32_le(self.mission_next_item);
9727 __tmp.put_i32_le(self.mission_end);
9728 __tmp.put_i32_le(self.commanded_action);
9729 if matches!(version, MavlinkVersion::V2) {
9730 let len = __tmp.len();
9731 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9732 } else {
9733 __tmp.len()
9734 }
9735 }
9736}
9737#[doc = "id: 162"]
9738#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
9739#[derive(Debug, Clone, PartialEq)]
9740#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9741#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9742pub struct FENCE_STATUS_DATA {
9743 #[doc = "Time (since boot) of last breach."]
9744 pub breach_time: u32,
9745 #[doc = "Number of fence breaches."]
9746 pub breach_count: u16,
9747 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
9748 pub breach_status: u8,
9749 #[doc = "Last breach type."]
9750 pub breach_type: FenceBreach,
9751 #[doc = "Active action to prevent fence breach"]
9752 #[cfg_attr(feature = "serde", serde(default))]
9753 pub breach_mitigation: FenceMitigate,
9754}
9755impl FENCE_STATUS_DATA {
9756 pub const ENCODED_LEN: usize = 9usize;
9757 pub const DEFAULT: Self = Self {
9758 breach_time: 0_u32,
9759 breach_count: 0_u16,
9760 breach_status: 0_u8,
9761 breach_type: FenceBreach::DEFAULT,
9762 breach_mitigation: FenceMitigate::DEFAULT,
9763 };
9764 #[cfg(feature = "arbitrary")]
9765 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9766 use arbitrary::{Arbitrary, Unstructured};
9767 let mut buf = [0u8; 1024];
9768 rng.fill_bytes(&mut buf);
9769 let mut unstructured = Unstructured::new(&buf);
9770 Self::arbitrary(&mut unstructured).unwrap_or_default()
9771 }
9772}
9773impl Default for FENCE_STATUS_DATA {
9774 fn default() -> Self {
9775 Self::DEFAULT.clone()
9776 }
9777}
9778impl MessageData for FENCE_STATUS_DATA {
9779 type Message = MavMessage;
9780 const ID: u32 = 162u32;
9781 const NAME: &'static str = "FENCE_STATUS";
9782 const EXTRA_CRC: u8 = 189u8;
9783 const ENCODED_LEN: usize = 9usize;
9784 fn deser(
9785 _version: MavlinkVersion,
9786 __input: &[u8],
9787 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9788 let avail_len = __input.len();
9789 let mut payload_buf = [0; Self::ENCODED_LEN];
9790 let mut buf = if avail_len < Self::ENCODED_LEN {
9791 payload_buf[0..avail_len].copy_from_slice(__input);
9792 Bytes::new(&payload_buf)
9793 } else {
9794 Bytes::new(__input)
9795 };
9796 let mut __struct = Self::default();
9797 __struct.breach_time = buf.get_u32_le();
9798 __struct.breach_count = buf.get_u16_le();
9799 __struct.breach_status = buf.get_u8();
9800 let tmp = buf.get_u8();
9801 __struct.breach_type =
9802 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9803 enum_type: "FenceBreach",
9804 value: tmp as u32,
9805 })?;
9806 let tmp = buf.get_u8();
9807 __struct.breach_mitigation =
9808 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9809 enum_type: "FenceMitigate",
9810 value: tmp as u32,
9811 })?;
9812 Ok(__struct)
9813 }
9814 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9815 let mut __tmp = BytesMut::new(bytes);
9816 #[allow(clippy::absurd_extreme_comparisons)]
9817 #[allow(unused_comparisons)]
9818 if __tmp.remaining() < Self::ENCODED_LEN {
9819 panic!(
9820 "buffer is too small (need {} bytes, but got {})",
9821 Self::ENCODED_LEN,
9822 __tmp.remaining(),
9823 )
9824 }
9825 __tmp.put_u32_le(self.breach_time);
9826 __tmp.put_u16_le(self.breach_count);
9827 __tmp.put_u8(self.breach_status);
9828 __tmp.put_u8(self.breach_type as u8);
9829 __tmp.put_u8(self.breach_mitigation as u8);
9830 if matches!(version, MavlinkVersion::V2) {
9831 let len = __tmp.len();
9832 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9833 } else {
9834 __tmp.len()
9835 }
9836 }
9837}
9838#[doc = "id: 25"]
9839#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
9840#[derive(Debug, Clone, PartialEq)]
9841#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9842#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9843pub struct GPS_STATUS_DATA {
9844 #[doc = "Number of satellites visible"]
9845 pub satellites_visible: u8,
9846 #[doc = "Global satellite ID"]
9847 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9848 pub satellite_prn: [u8; 20],
9849 #[doc = "0: Satellite not used, 1: used for localization"]
9850 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9851 pub satellite_used: [u8; 20],
9852 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
9853 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9854 pub satellite_elevation: [u8; 20],
9855 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
9856 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9857 pub satellite_azimuth: [u8; 20],
9858 #[doc = "Signal to noise ratio of satellite"]
9859 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9860 pub satellite_snr: [u8; 20],
9861}
9862impl GPS_STATUS_DATA {
9863 pub const ENCODED_LEN: usize = 101usize;
9864 pub const DEFAULT: Self = Self {
9865 satellites_visible: 0_u8,
9866 satellite_prn: [0_u8; 20usize],
9867 satellite_used: [0_u8; 20usize],
9868 satellite_elevation: [0_u8; 20usize],
9869 satellite_azimuth: [0_u8; 20usize],
9870 satellite_snr: [0_u8; 20usize],
9871 };
9872 #[cfg(feature = "arbitrary")]
9873 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9874 use arbitrary::{Arbitrary, Unstructured};
9875 let mut buf = [0u8; 1024];
9876 rng.fill_bytes(&mut buf);
9877 let mut unstructured = Unstructured::new(&buf);
9878 Self::arbitrary(&mut unstructured).unwrap_or_default()
9879 }
9880}
9881impl Default for GPS_STATUS_DATA {
9882 fn default() -> Self {
9883 Self::DEFAULT.clone()
9884 }
9885}
9886impl MessageData for GPS_STATUS_DATA {
9887 type Message = MavMessage;
9888 const ID: u32 = 25u32;
9889 const NAME: &'static str = "GPS_STATUS";
9890 const EXTRA_CRC: u8 = 23u8;
9891 const ENCODED_LEN: usize = 101usize;
9892 fn deser(
9893 _version: MavlinkVersion,
9894 __input: &[u8],
9895 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9896 let avail_len = __input.len();
9897 let mut payload_buf = [0; Self::ENCODED_LEN];
9898 let mut buf = if avail_len < Self::ENCODED_LEN {
9899 payload_buf[0..avail_len].copy_from_slice(__input);
9900 Bytes::new(&payload_buf)
9901 } else {
9902 Bytes::new(__input)
9903 };
9904 let mut __struct = Self::default();
9905 __struct.satellites_visible = buf.get_u8();
9906 for v in &mut __struct.satellite_prn {
9907 let val = buf.get_u8();
9908 *v = val;
9909 }
9910 for v in &mut __struct.satellite_used {
9911 let val = buf.get_u8();
9912 *v = val;
9913 }
9914 for v in &mut __struct.satellite_elevation {
9915 let val = buf.get_u8();
9916 *v = val;
9917 }
9918 for v in &mut __struct.satellite_azimuth {
9919 let val = buf.get_u8();
9920 *v = val;
9921 }
9922 for v in &mut __struct.satellite_snr {
9923 let val = buf.get_u8();
9924 *v = val;
9925 }
9926 Ok(__struct)
9927 }
9928 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9929 let mut __tmp = BytesMut::new(bytes);
9930 #[allow(clippy::absurd_extreme_comparisons)]
9931 #[allow(unused_comparisons)]
9932 if __tmp.remaining() < Self::ENCODED_LEN {
9933 panic!(
9934 "buffer is too small (need {} bytes, but got {})",
9935 Self::ENCODED_LEN,
9936 __tmp.remaining(),
9937 )
9938 }
9939 __tmp.put_u8(self.satellites_visible);
9940 for val in &self.satellite_prn {
9941 __tmp.put_u8(*val);
9942 }
9943 for val in &self.satellite_used {
9944 __tmp.put_u8(*val);
9945 }
9946 for val in &self.satellite_elevation {
9947 __tmp.put_u8(*val);
9948 }
9949 for val in &self.satellite_azimuth {
9950 __tmp.put_u8(*val);
9951 }
9952 for val in &self.satellite_snr {
9953 __tmp.put_u8(*val);
9954 }
9955 if matches!(version, MavlinkVersion::V2) {
9956 let len = __tmp.len();
9957 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9958 } else {
9959 __tmp.len()
9960 }
9961 }
9962}
9963#[doc = "id: 26"]
9964#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
9965#[derive(Debug, Clone, PartialEq)]
9966#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9967#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9968pub struct SCALED_IMU_DATA {
9969 #[doc = "Timestamp (time since system boot)."]
9970 pub time_boot_ms: u32,
9971 #[doc = "X acceleration"]
9972 pub xacc: i16,
9973 #[doc = "Y acceleration"]
9974 pub yacc: i16,
9975 #[doc = "Z acceleration"]
9976 pub zacc: i16,
9977 #[doc = "Angular speed around X axis"]
9978 pub xgyro: i16,
9979 #[doc = "Angular speed around Y axis"]
9980 pub ygyro: i16,
9981 #[doc = "Angular speed around Z axis"]
9982 pub zgyro: i16,
9983 #[doc = "X Magnetic field"]
9984 pub xmag: i16,
9985 #[doc = "Y Magnetic field"]
9986 pub ymag: i16,
9987 #[doc = "Z Magnetic field"]
9988 pub zmag: i16,
9989 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
9990 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9991 pub temperature: i16,
9992}
9993impl SCALED_IMU_DATA {
9994 pub const ENCODED_LEN: usize = 24usize;
9995 pub const DEFAULT: Self = Self {
9996 time_boot_ms: 0_u32,
9997 xacc: 0_i16,
9998 yacc: 0_i16,
9999 zacc: 0_i16,
10000 xgyro: 0_i16,
10001 ygyro: 0_i16,
10002 zgyro: 0_i16,
10003 xmag: 0_i16,
10004 ymag: 0_i16,
10005 zmag: 0_i16,
10006 temperature: 0_i16,
10007 };
10008 #[cfg(feature = "arbitrary")]
10009 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10010 use arbitrary::{Arbitrary, Unstructured};
10011 let mut buf = [0u8; 1024];
10012 rng.fill_bytes(&mut buf);
10013 let mut unstructured = Unstructured::new(&buf);
10014 Self::arbitrary(&mut unstructured).unwrap_or_default()
10015 }
10016}
10017impl Default for SCALED_IMU_DATA {
10018 fn default() -> Self {
10019 Self::DEFAULT.clone()
10020 }
10021}
10022impl MessageData for SCALED_IMU_DATA {
10023 type Message = MavMessage;
10024 const ID: u32 = 26u32;
10025 const NAME: &'static str = "SCALED_IMU";
10026 const EXTRA_CRC: u8 = 170u8;
10027 const ENCODED_LEN: usize = 24usize;
10028 fn deser(
10029 _version: MavlinkVersion,
10030 __input: &[u8],
10031 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10032 let avail_len = __input.len();
10033 let mut payload_buf = [0; Self::ENCODED_LEN];
10034 let mut buf = if avail_len < Self::ENCODED_LEN {
10035 payload_buf[0..avail_len].copy_from_slice(__input);
10036 Bytes::new(&payload_buf)
10037 } else {
10038 Bytes::new(__input)
10039 };
10040 let mut __struct = Self::default();
10041 __struct.time_boot_ms = buf.get_u32_le();
10042 __struct.xacc = buf.get_i16_le();
10043 __struct.yacc = buf.get_i16_le();
10044 __struct.zacc = buf.get_i16_le();
10045 __struct.xgyro = buf.get_i16_le();
10046 __struct.ygyro = buf.get_i16_le();
10047 __struct.zgyro = buf.get_i16_le();
10048 __struct.xmag = buf.get_i16_le();
10049 __struct.ymag = buf.get_i16_le();
10050 __struct.zmag = buf.get_i16_le();
10051 __struct.temperature = buf.get_i16_le();
10052 Ok(__struct)
10053 }
10054 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10055 let mut __tmp = BytesMut::new(bytes);
10056 #[allow(clippy::absurd_extreme_comparisons)]
10057 #[allow(unused_comparisons)]
10058 if __tmp.remaining() < Self::ENCODED_LEN {
10059 panic!(
10060 "buffer is too small (need {} bytes, but got {})",
10061 Self::ENCODED_LEN,
10062 __tmp.remaining(),
10063 )
10064 }
10065 __tmp.put_u32_le(self.time_boot_ms);
10066 __tmp.put_i16_le(self.xacc);
10067 __tmp.put_i16_le(self.yacc);
10068 __tmp.put_i16_le(self.zacc);
10069 __tmp.put_i16_le(self.xgyro);
10070 __tmp.put_i16_le(self.ygyro);
10071 __tmp.put_i16_le(self.zgyro);
10072 __tmp.put_i16_le(self.xmag);
10073 __tmp.put_i16_le(self.ymag);
10074 __tmp.put_i16_le(self.zmag);
10075 __tmp.put_i16_le(self.temperature);
10076 if matches!(version, MavlinkVersion::V2) {
10077 let len = __tmp.len();
10078 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10079 } else {
10080 __tmp.len()
10081 }
10082 }
10083}
10084#[doc = "id: 266"]
10085#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
10086#[derive(Debug, Clone, PartialEq)]
10087#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10088#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10089pub struct LOGGING_DATA_DATA {
10090 #[doc = "sequence number (can wrap)"]
10091 pub sequence: u16,
10092 #[doc = "system ID of the target"]
10093 pub target_system: u8,
10094 #[doc = "component ID of the target"]
10095 pub target_component: u8,
10096 #[doc = "data length"]
10097 pub length: u8,
10098 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
10099 pub first_message_offset: u8,
10100 #[doc = "logged data"]
10101 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10102 pub data: [u8; 249],
10103}
10104impl LOGGING_DATA_DATA {
10105 pub const ENCODED_LEN: usize = 255usize;
10106 pub const DEFAULT: Self = Self {
10107 sequence: 0_u16,
10108 target_system: 0_u8,
10109 target_component: 0_u8,
10110 length: 0_u8,
10111 first_message_offset: 0_u8,
10112 data: [0_u8; 249usize],
10113 };
10114 #[cfg(feature = "arbitrary")]
10115 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10116 use arbitrary::{Arbitrary, Unstructured};
10117 let mut buf = [0u8; 1024];
10118 rng.fill_bytes(&mut buf);
10119 let mut unstructured = Unstructured::new(&buf);
10120 Self::arbitrary(&mut unstructured).unwrap_or_default()
10121 }
10122}
10123impl Default for LOGGING_DATA_DATA {
10124 fn default() -> Self {
10125 Self::DEFAULT.clone()
10126 }
10127}
10128impl MessageData for LOGGING_DATA_DATA {
10129 type Message = MavMessage;
10130 const ID: u32 = 266u32;
10131 const NAME: &'static str = "LOGGING_DATA";
10132 const EXTRA_CRC: u8 = 193u8;
10133 const ENCODED_LEN: usize = 255usize;
10134 fn deser(
10135 _version: MavlinkVersion,
10136 __input: &[u8],
10137 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10138 let avail_len = __input.len();
10139 let mut payload_buf = [0; Self::ENCODED_LEN];
10140 let mut buf = if avail_len < Self::ENCODED_LEN {
10141 payload_buf[0..avail_len].copy_from_slice(__input);
10142 Bytes::new(&payload_buf)
10143 } else {
10144 Bytes::new(__input)
10145 };
10146 let mut __struct = Self::default();
10147 __struct.sequence = buf.get_u16_le();
10148 __struct.target_system = buf.get_u8();
10149 __struct.target_component = buf.get_u8();
10150 __struct.length = buf.get_u8();
10151 __struct.first_message_offset = buf.get_u8();
10152 for v in &mut __struct.data {
10153 let val = buf.get_u8();
10154 *v = val;
10155 }
10156 Ok(__struct)
10157 }
10158 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10159 let mut __tmp = BytesMut::new(bytes);
10160 #[allow(clippy::absurd_extreme_comparisons)]
10161 #[allow(unused_comparisons)]
10162 if __tmp.remaining() < Self::ENCODED_LEN {
10163 panic!(
10164 "buffer is too small (need {} bytes, but got {})",
10165 Self::ENCODED_LEN,
10166 __tmp.remaining(),
10167 )
10168 }
10169 __tmp.put_u16_le(self.sequence);
10170 __tmp.put_u8(self.target_system);
10171 __tmp.put_u8(self.target_component);
10172 __tmp.put_u8(self.length);
10173 __tmp.put_u8(self.first_message_offset);
10174 for val in &self.data {
10175 __tmp.put_u8(*val);
10176 }
10177 if matches!(version, MavlinkVersion::V2) {
10178 let len = __tmp.len();
10179 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10180 } else {
10181 __tmp.len()
10182 }
10183 }
10184}
10185#[doc = "id: 233"]
10186#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
10187#[derive(Debug, Clone, PartialEq)]
10188#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10189#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10190pub struct GPS_RTCM_DATA_DATA {
10191 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
10192 pub flags: u8,
10193 #[doc = "data length"]
10194 pub len: u8,
10195 #[doc = "RTCM message (may be fragmented)"]
10196 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10197 pub data: [u8; 180],
10198}
10199impl GPS_RTCM_DATA_DATA {
10200 pub const ENCODED_LEN: usize = 182usize;
10201 pub const DEFAULT: Self = Self {
10202 flags: 0_u8,
10203 len: 0_u8,
10204 data: [0_u8; 180usize],
10205 };
10206 #[cfg(feature = "arbitrary")]
10207 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10208 use arbitrary::{Arbitrary, Unstructured};
10209 let mut buf = [0u8; 1024];
10210 rng.fill_bytes(&mut buf);
10211 let mut unstructured = Unstructured::new(&buf);
10212 Self::arbitrary(&mut unstructured).unwrap_or_default()
10213 }
10214}
10215impl Default for GPS_RTCM_DATA_DATA {
10216 fn default() -> Self {
10217 Self::DEFAULT.clone()
10218 }
10219}
10220impl MessageData for GPS_RTCM_DATA_DATA {
10221 type Message = MavMessage;
10222 const ID: u32 = 233u32;
10223 const NAME: &'static str = "GPS_RTCM_DATA";
10224 const EXTRA_CRC: u8 = 35u8;
10225 const ENCODED_LEN: usize = 182usize;
10226 fn deser(
10227 _version: MavlinkVersion,
10228 __input: &[u8],
10229 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10230 let avail_len = __input.len();
10231 let mut payload_buf = [0; Self::ENCODED_LEN];
10232 let mut buf = if avail_len < Self::ENCODED_LEN {
10233 payload_buf[0..avail_len].copy_from_slice(__input);
10234 Bytes::new(&payload_buf)
10235 } else {
10236 Bytes::new(__input)
10237 };
10238 let mut __struct = Self::default();
10239 __struct.flags = buf.get_u8();
10240 __struct.len = buf.get_u8();
10241 for v in &mut __struct.data {
10242 let val = buf.get_u8();
10243 *v = val;
10244 }
10245 Ok(__struct)
10246 }
10247 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10248 let mut __tmp = BytesMut::new(bytes);
10249 #[allow(clippy::absurd_extreme_comparisons)]
10250 #[allow(unused_comparisons)]
10251 if __tmp.remaining() < Self::ENCODED_LEN {
10252 panic!(
10253 "buffer is too small (need {} bytes, but got {})",
10254 Self::ENCODED_LEN,
10255 __tmp.remaining(),
10256 )
10257 }
10258 __tmp.put_u8(self.flags);
10259 __tmp.put_u8(self.len);
10260 for val in &self.data {
10261 __tmp.put_u8(*val);
10262 }
10263 if matches!(version, MavlinkVersion::V2) {
10264 let len = __tmp.len();
10265 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10266 } else {
10267 __tmp.len()
10268 }
10269 }
10270}
10271#[doc = "id: 63"]
10272#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
10273#[derive(Debug, Clone, PartialEq)]
10274#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10275#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10276pub struct GLOBAL_POSITION_INT_COV_DATA {
10277 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10278 pub time_usec: u64,
10279 #[doc = "Latitude"]
10280 pub lat: i32,
10281 #[doc = "Longitude"]
10282 pub lon: i32,
10283 #[doc = "Altitude in meters above MSL"]
10284 pub alt: i32,
10285 #[doc = "Altitude above ground"]
10286 pub relative_alt: i32,
10287 #[doc = "Ground X Speed (Latitude)"]
10288 pub vx: f32,
10289 #[doc = "Ground Y Speed (Longitude)"]
10290 pub vy: f32,
10291 #[doc = "Ground Z Speed (Altitude)"]
10292 pub vz: f32,
10293 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
10294 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10295 pub covariance: [f32; 36],
10296 #[doc = "Class id of the estimator this estimate originated from."]
10297 pub estimator_type: MavEstimatorType,
10298}
10299impl GLOBAL_POSITION_INT_COV_DATA {
10300 pub const ENCODED_LEN: usize = 181usize;
10301 pub const DEFAULT: Self = Self {
10302 time_usec: 0_u64,
10303 lat: 0_i32,
10304 lon: 0_i32,
10305 alt: 0_i32,
10306 relative_alt: 0_i32,
10307 vx: 0.0_f32,
10308 vy: 0.0_f32,
10309 vz: 0.0_f32,
10310 covariance: [0.0_f32; 36usize],
10311 estimator_type: MavEstimatorType::DEFAULT,
10312 };
10313 #[cfg(feature = "arbitrary")]
10314 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10315 use arbitrary::{Arbitrary, Unstructured};
10316 let mut buf = [0u8; 1024];
10317 rng.fill_bytes(&mut buf);
10318 let mut unstructured = Unstructured::new(&buf);
10319 Self::arbitrary(&mut unstructured).unwrap_or_default()
10320 }
10321}
10322impl Default for GLOBAL_POSITION_INT_COV_DATA {
10323 fn default() -> Self {
10324 Self::DEFAULT.clone()
10325 }
10326}
10327impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
10328 type Message = MavMessage;
10329 const ID: u32 = 63u32;
10330 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
10331 const EXTRA_CRC: u8 = 119u8;
10332 const ENCODED_LEN: usize = 181usize;
10333 fn deser(
10334 _version: MavlinkVersion,
10335 __input: &[u8],
10336 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10337 let avail_len = __input.len();
10338 let mut payload_buf = [0; Self::ENCODED_LEN];
10339 let mut buf = if avail_len < Self::ENCODED_LEN {
10340 payload_buf[0..avail_len].copy_from_slice(__input);
10341 Bytes::new(&payload_buf)
10342 } else {
10343 Bytes::new(__input)
10344 };
10345 let mut __struct = Self::default();
10346 __struct.time_usec = buf.get_u64_le();
10347 __struct.lat = buf.get_i32_le();
10348 __struct.lon = buf.get_i32_le();
10349 __struct.alt = buf.get_i32_le();
10350 __struct.relative_alt = buf.get_i32_le();
10351 __struct.vx = buf.get_f32_le();
10352 __struct.vy = buf.get_f32_le();
10353 __struct.vz = buf.get_f32_le();
10354 for v in &mut __struct.covariance {
10355 let val = buf.get_f32_le();
10356 *v = val;
10357 }
10358 let tmp = buf.get_u8();
10359 __struct.estimator_type =
10360 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10361 enum_type: "MavEstimatorType",
10362 value: tmp as u32,
10363 })?;
10364 Ok(__struct)
10365 }
10366 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10367 let mut __tmp = BytesMut::new(bytes);
10368 #[allow(clippy::absurd_extreme_comparisons)]
10369 #[allow(unused_comparisons)]
10370 if __tmp.remaining() < Self::ENCODED_LEN {
10371 panic!(
10372 "buffer is too small (need {} bytes, but got {})",
10373 Self::ENCODED_LEN,
10374 __tmp.remaining(),
10375 )
10376 }
10377 __tmp.put_u64_le(self.time_usec);
10378 __tmp.put_i32_le(self.lat);
10379 __tmp.put_i32_le(self.lon);
10380 __tmp.put_i32_le(self.alt);
10381 __tmp.put_i32_le(self.relative_alt);
10382 __tmp.put_f32_le(self.vx);
10383 __tmp.put_f32_le(self.vy);
10384 __tmp.put_f32_le(self.vz);
10385 for val in &self.covariance {
10386 __tmp.put_f32_le(*val);
10387 }
10388 __tmp.put_u8(self.estimator_type as u8);
10389 if matches!(version, MavlinkVersion::V2) {
10390 let len = __tmp.len();
10391 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10392 } else {
10393 __tmp.len()
10394 }
10395 }
10396}
10397#[doc = "id: 28"]
10398#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
10399#[derive(Debug, Clone, PartialEq)]
10400#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10401#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10402pub struct RAW_PRESSURE_DATA {
10403 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10404 pub time_usec: u64,
10405 #[doc = "Absolute pressure (raw)"]
10406 pub press_abs: i16,
10407 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
10408 pub press_diff1: i16,
10409 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
10410 pub press_diff2: i16,
10411 #[doc = "Raw Temperature measurement (raw)"]
10412 pub temperature: i16,
10413}
10414impl RAW_PRESSURE_DATA {
10415 pub const ENCODED_LEN: usize = 16usize;
10416 pub const DEFAULT: Self = Self {
10417 time_usec: 0_u64,
10418 press_abs: 0_i16,
10419 press_diff1: 0_i16,
10420 press_diff2: 0_i16,
10421 temperature: 0_i16,
10422 };
10423 #[cfg(feature = "arbitrary")]
10424 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10425 use arbitrary::{Arbitrary, Unstructured};
10426 let mut buf = [0u8; 1024];
10427 rng.fill_bytes(&mut buf);
10428 let mut unstructured = Unstructured::new(&buf);
10429 Self::arbitrary(&mut unstructured).unwrap_or_default()
10430 }
10431}
10432impl Default for RAW_PRESSURE_DATA {
10433 fn default() -> Self {
10434 Self::DEFAULT.clone()
10435 }
10436}
10437impl MessageData for RAW_PRESSURE_DATA {
10438 type Message = MavMessage;
10439 const ID: u32 = 28u32;
10440 const NAME: &'static str = "RAW_PRESSURE";
10441 const EXTRA_CRC: u8 = 67u8;
10442 const ENCODED_LEN: usize = 16usize;
10443 fn deser(
10444 _version: MavlinkVersion,
10445 __input: &[u8],
10446 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10447 let avail_len = __input.len();
10448 let mut payload_buf = [0; Self::ENCODED_LEN];
10449 let mut buf = if avail_len < Self::ENCODED_LEN {
10450 payload_buf[0..avail_len].copy_from_slice(__input);
10451 Bytes::new(&payload_buf)
10452 } else {
10453 Bytes::new(__input)
10454 };
10455 let mut __struct = Self::default();
10456 __struct.time_usec = buf.get_u64_le();
10457 __struct.press_abs = buf.get_i16_le();
10458 __struct.press_diff1 = buf.get_i16_le();
10459 __struct.press_diff2 = buf.get_i16_le();
10460 __struct.temperature = buf.get_i16_le();
10461 Ok(__struct)
10462 }
10463 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10464 let mut __tmp = BytesMut::new(bytes);
10465 #[allow(clippy::absurd_extreme_comparisons)]
10466 #[allow(unused_comparisons)]
10467 if __tmp.remaining() < Self::ENCODED_LEN {
10468 panic!(
10469 "buffer is too small (need {} bytes, but got {})",
10470 Self::ENCODED_LEN,
10471 __tmp.remaining(),
10472 )
10473 }
10474 __tmp.put_u64_le(self.time_usec);
10475 __tmp.put_i16_le(self.press_abs);
10476 __tmp.put_i16_le(self.press_diff1);
10477 __tmp.put_i16_le(self.press_diff2);
10478 __tmp.put_i16_le(self.temperature);
10479 if matches!(version, MavlinkVersion::V2) {
10480 let len = __tmp.len();
10481 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10482 } else {
10483 __tmp.len()
10484 }
10485 }
10486}
10487#[doc = "id: 76"]
10488#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
10489#[derive(Debug, Clone, PartialEq)]
10490#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10491#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10492pub struct COMMAND_LONG_DATA {
10493 #[doc = "Parameter 1 (for the specific command)."]
10494 pub param1: f32,
10495 #[doc = "Parameter 2 (for the specific command)."]
10496 pub param2: f32,
10497 #[doc = "Parameter 3 (for the specific command)."]
10498 pub param3: f32,
10499 #[doc = "Parameter 4 (for the specific command)."]
10500 pub param4: f32,
10501 #[doc = "Parameter 5 (for the specific command)."]
10502 pub param5: f32,
10503 #[doc = "Parameter 6 (for the specific command)."]
10504 pub param6: f32,
10505 #[doc = "Parameter 7 (for the specific command)."]
10506 pub param7: f32,
10507 #[doc = "Command ID (of command to send)."]
10508 pub command: MavCmd,
10509 #[doc = "System which should execute the command"]
10510 pub target_system: u8,
10511 #[doc = "Component which should execute the command, 0 for all components"]
10512 pub target_component: u8,
10513 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
10514 pub confirmation: u8,
10515}
10516impl COMMAND_LONG_DATA {
10517 pub const ENCODED_LEN: usize = 33usize;
10518 pub const DEFAULT: Self = Self {
10519 param1: 0.0_f32,
10520 param2: 0.0_f32,
10521 param3: 0.0_f32,
10522 param4: 0.0_f32,
10523 param5: 0.0_f32,
10524 param6: 0.0_f32,
10525 param7: 0.0_f32,
10526 command: MavCmd::DEFAULT,
10527 target_system: 0_u8,
10528 target_component: 0_u8,
10529 confirmation: 0_u8,
10530 };
10531 #[cfg(feature = "arbitrary")]
10532 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10533 use arbitrary::{Arbitrary, Unstructured};
10534 let mut buf = [0u8; 1024];
10535 rng.fill_bytes(&mut buf);
10536 let mut unstructured = Unstructured::new(&buf);
10537 Self::arbitrary(&mut unstructured).unwrap_or_default()
10538 }
10539}
10540impl Default for COMMAND_LONG_DATA {
10541 fn default() -> Self {
10542 Self::DEFAULT.clone()
10543 }
10544}
10545impl MessageData for COMMAND_LONG_DATA {
10546 type Message = MavMessage;
10547 const ID: u32 = 76u32;
10548 const NAME: &'static str = "COMMAND_LONG";
10549 const EXTRA_CRC: u8 = 152u8;
10550 const ENCODED_LEN: usize = 33usize;
10551 fn deser(
10552 _version: MavlinkVersion,
10553 __input: &[u8],
10554 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10555 let avail_len = __input.len();
10556 let mut payload_buf = [0; Self::ENCODED_LEN];
10557 let mut buf = if avail_len < Self::ENCODED_LEN {
10558 payload_buf[0..avail_len].copy_from_slice(__input);
10559 Bytes::new(&payload_buf)
10560 } else {
10561 Bytes::new(__input)
10562 };
10563 let mut __struct = Self::default();
10564 __struct.param1 = buf.get_f32_le();
10565 __struct.param2 = buf.get_f32_le();
10566 __struct.param3 = buf.get_f32_le();
10567 __struct.param4 = buf.get_f32_le();
10568 __struct.param5 = buf.get_f32_le();
10569 __struct.param6 = buf.get_f32_le();
10570 __struct.param7 = buf.get_f32_le();
10571 let tmp = buf.get_u16_le();
10572 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
10573 ::mavlink_core::error::ParserError::InvalidEnum {
10574 enum_type: "MavCmd",
10575 value: tmp as u32,
10576 },
10577 )?;
10578 __struct.target_system = buf.get_u8();
10579 __struct.target_component = buf.get_u8();
10580 __struct.confirmation = buf.get_u8();
10581 Ok(__struct)
10582 }
10583 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10584 let mut __tmp = BytesMut::new(bytes);
10585 #[allow(clippy::absurd_extreme_comparisons)]
10586 #[allow(unused_comparisons)]
10587 if __tmp.remaining() < Self::ENCODED_LEN {
10588 panic!(
10589 "buffer is too small (need {} bytes, but got {})",
10590 Self::ENCODED_LEN,
10591 __tmp.remaining(),
10592 )
10593 }
10594 __tmp.put_f32_le(self.param1);
10595 __tmp.put_f32_le(self.param2);
10596 __tmp.put_f32_le(self.param3);
10597 __tmp.put_f32_le(self.param4);
10598 __tmp.put_f32_le(self.param5);
10599 __tmp.put_f32_le(self.param6);
10600 __tmp.put_f32_le(self.param7);
10601 __tmp.put_u16_le(self.command as u16);
10602 __tmp.put_u8(self.target_system);
10603 __tmp.put_u8(self.target_component);
10604 __tmp.put_u8(self.confirmation);
10605 if matches!(version, MavlinkVersion::V2) {
10606 let len = __tmp.len();
10607 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10608 } else {
10609 __tmp.len()
10610 }
10611 }
10612}
10613#[doc = "id: 148"]
10614#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
10615#[derive(Debug, Clone, PartialEq)]
10616#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10617#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10618pub struct AUTOPILOT_VERSION_DATA {
10619 #[doc = "Bitmap of capabilities"]
10620 pub capabilities: MavProtocolCapability,
10621 #[doc = "UID if provided by hardware (see uid2)"]
10622 pub uid: u64,
10623 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
10624 pub flight_sw_version: u32,
10625 #[doc = "Middleware version number"]
10626 pub middleware_sw_version: u32,
10627 #[doc = "Operating system version number"]
10628 pub os_sw_version: u32,
10629 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
10630 pub board_version: u32,
10631 #[doc = "ID of the board vendor"]
10632 pub vendor_id: u16,
10633 #[doc = "ID of the product"]
10634 pub product_id: u16,
10635 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
10636 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10637 pub flight_custom_version: [u8; 8],
10638 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
10639 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10640 pub middleware_custom_version: [u8; 8],
10641 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
10642 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10643 pub os_custom_version: [u8; 8],
10644 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
10645 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10646 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10647 pub uid2: [u8; 18],
10648}
10649impl AUTOPILOT_VERSION_DATA {
10650 pub const ENCODED_LEN: usize = 78usize;
10651 pub const DEFAULT: Self = Self {
10652 capabilities: MavProtocolCapability::DEFAULT,
10653 uid: 0_u64,
10654 flight_sw_version: 0_u32,
10655 middleware_sw_version: 0_u32,
10656 os_sw_version: 0_u32,
10657 board_version: 0_u32,
10658 vendor_id: 0_u16,
10659 product_id: 0_u16,
10660 flight_custom_version: [0_u8; 8usize],
10661 middleware_custom_version: [0_u8; 8usize],
10662 os_custom_version: [0_u8; 8usize],
10663 uid2: [0_u8; 18usize],
10664 };
10665 #[cfg(feature = "arbitrary")]
10666 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10667 use arbitrary::{Arbitrary, Unstructured};
10668 let mut buf = [0u8; 1024];
10669 rng.fill_bytes(&mut buf);
10670 let mut unstructured = Unstructured::new(&buf);
10671 Self::arbitrary(&mut unstructured).unwrap_or_default()
10672 }
10673}
10674impl Default for AUTOPILOT_VERSION_DATA {
10675 fn default() -> Self {
10676 Self::DEFAULT.clone()
10677 }
10678}
10679impl MessageData for AUTOPILOT_VERSION_DATA {
10680 type Message = MavMessage;
10681 const ID: u32 = 148u32;
10682 const NAME: &'static str = "AUTOPILOT_VERSION";
10683 const EXTRA_CRC: u8 = 178u8;
10684 const ENCODED_LEN: usize = 78usize;
10685 fn deser(
10686 _version: MavlinkVersion,
10687 __input: &[u8],
10688 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10689 let avail_len = __input.len();
10690 let mut payload_buf = [0; Self::ENCODED_LEN];
10691 let mut buf = if avail_len < Self::ENCODED_LEN {
10692 payload_buf[0..avail_len].copy_from_slice(__input);
10693 Bytes::new(&payload_buf)
10694 } else {
10695 Bytes::new(__input)
10696 };
10697 let mut __struct = Self::default();
10698 let tmp = buf.get_u64_le();
10699 __struct.capabilities = MavProtocolCapability::from_bits(
10700 tmp & MavProtocolCapability::all().bits(),
10701 )
10702 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
10703 flag_type: "MavProtocolCapability",
10704 value: tmp as u32,
10705 })?;
10706 __struct.uid = buf.get_u64_le();
10707 __struct.flight_sw_version = buf.get_u32_le();
10708 __struct.middleware_sw_version = buf.get_u32_le();
10709 __struct.os_sw_version = buf.get_u32_le();
10710 __struct.board_version = buf.get_u32_le();
10711 __struct.vendor_id = buf.get_u16_le();
10712 __struct.product_id = buf.get_u16_le();
10713 for v in &mut __struct.flight_custom_version {
10714 let val = buf.get_u8();
10715 *v = val;
10716 }
10717 for v in &mut __struct.middleware_custom_version {
10718 let val = buf.get_u8();
10719 *v = val;
10720 }
10721 for v in &mut __struct.os_custom_version {
10722 let val = buf.get_u8();
10723 *v = val;
10724 }
10725 for v in &mut __struct.uid2 {
10726 let val = buf.get_u8();
10727 *v = val;
10728 }
10729 Ok(__struct)
10730 }
10731 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10732 let mut __tmp = BytesMut::new(bytes);
10733 #[allow(clippy::absurd_extreme_comparisons)]
10734 #[allow(unused_comparisons)]
10735 if __tmp.remaining() < Self::ENCODED_LEN {
10736 panic!(
10737 "buffer is too small (need {} bytes, but got {})",
10738 Self::ENCODED_LEN,
10739 __tmp.remaining(),
10740 )
10741 }
10742 __tmp.put_u64_le(self.capabilities.bits());
10743 __tmp.put_u64_le(self.uid);
10744 __tmp.put_u32_le(self.flight_sw_version);
10745 __tmp.put_u32_le(self.middleware_sw_version);
10746 __tmp.put_u32_le(self.os_sw_version);
10747 __tmp.put_u32_le(self.board_version);
10748 __tmp.put_u16_le(self.vendor_id);
10749 __tmp.put_u16_le(self.product_id);
10750 for val in &self.flight_custom_version {
10751 __tmp.put_u8(*val);
10752 }
10753 for val in &self.middleware_custom_version {
10754 __tmp.put_u8(*val);
10755 }
10756 for val in &self.os_custom_version {
10757 __tmp.put_u8(*val);
10758 }
10759 for val in &self.uid2 {
10760 __tmp.put_u8(*val);
10761 }
10762 if matches!(version, MavlinkVersion::V2) {
10763 let len = __tmp.len();
10764 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10765 } else {
10766 __tmp.len()
10767 }
10768 }
10769}
10770#[doc = "id: 336"]
10771#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
10772#[derive(Debug, Clone, PartialEq)]
10773#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10774#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10775pub struct CELLULAR_CONFIG_DATA {
10776 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
10777 pub enable_lte: u8,
10778 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
10779 pub enable_pin: u8,
10780 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
10781 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10782 pub pin: [u8; 16],
10783 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
10784 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10785 pub new_pin: [u8; 16],
10786 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
10787 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10788 pub apn: [u8; 32],
10789 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
10790 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10791 pub puk: [u8; 16],
10792 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
10793 pub roaming: u8,
10794 #[doc = "Message acceptance response (sent back to GS)."]
10795 pub response: CellularConfigResponse,
10796}
10797impl CELLULAR_CONFIG_DATA {
10798 pub const ENCODED_LEN: usize = 84usize;
10799 pub const DEFAULT: Self = Self {
10800 enable_lte: 0_u8,
10801 enable_pin: 0_u8,
10802 pin: [0_u8; 16usize],
10803 new_pin: [0_u8; 16usize],
10804 apn: [0_u8; 32usize],
10805 puk: [0_u8; 16usize],
10806 roaming: 0_u8,
10807 response: CellularConfigResponse::DEFAULT,
10808 };
10809 #[cfg(feature = "arbitrary")]
10810 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10811 use arbitrary::{Arbitrary, Unstructured};
10812 let mut buf = [0u8; 1024];
10813 rng.fill_bytes(&mut buf);
10814 let mut unstructured = Unstructured::new(&buf);
10815 Self::arbitrary(&mut unstructured).unwrap_or_default()
10816 }
10817}
10818impl Default for CELLULAR_CONFIG_DATA {
10819 fn default() -> Self {
10820 Self::DEFAULT.clone()
10821 }
10822}
10823impl MessageData for CELLULAR_CONFIG_DATA {
10824 type Message = MavMessage;
10825 const ID: u32 = 336u32;
10826 const NAME: &'static str = "CELLULAR_CONFIG";
10827 const EXTRA_CRC: u8 = 245u8;
10828 const ENCODED_LEN: usize = 84usize;
10829 fn deser(
10830 _version: MavlinkVersion,
10831 __input: &[u8],
10832 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10833 let avail_len = __input.len();
10834 let mut payload_buf = [0; Self::ENCODED_LEN];
10835 let mut buf = if avail_len < Self::ENCODED_LEN {
10836 payload_buf[0..avail_len].copy_from_slice(__input);
10837 Bytes::new(&payload_buf)
10838 } else {
10839 Bytes::new(__input)
10840 };
10841 let mut __struct = Self::default();
10842 __struct.enable_lte = buf.get_u8();
10843 __struct.enable_pin = buf.get_u8();
10844 for v in &mut __struct.pin {
10845 let val = buf.get_u8();
10846 *v = val;
10847 }
10848 for v in &mut __struct.new_pin {
10849 let val = buf.get_u8();
10850 *v = val;
10851 }
10852 for v in &mut __struct.apn {
10853 let val = buf.get_u8();
10854 *v = val;
10855 }
10856 for v in &mut __struct.puk {
10857 let val = buf.get_u8();
10858 *v = val;
10859 }
10860 __struct.roaming = buf.get_u8();
10861 let tmp = buf.get_u8();
10862 __struct.response =
10863 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10864 enum_type: "CellularConfigResponse",
10865 value: tmp as u32,
10866 })?;
10867 Ok(__struct)
10868 }
10869 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10870 let mut __tmp = BytesMut::new(bytes);
10871 #[allow(clippy::absurd_extreme_comparisons)]
10872 #[allow(unused_comparisons)]
10873 if __tmp.remaining() < Self::ENCODED_LEN {
10874 panic!(
10875 "buffer is too small (need {} bytes, but got {})",
10876 Self::ENCODED_LEN,
10877 __tmp.remaining(),
10878 )
10879 }
10880 __tmp.put_u8(self.enable_lte);
10881 __tmp.put_u8(self.enable_pin);
10882 for val in &self.pin {
10883 __tmp.put_u8(*val);
10884 }
10885 for val in &self.new_pin {
10886 __tmp.put_u8(*val);
10887 }
10888 for val in &self.apn {
10889 __tmp.put_u8(*val);
10890 }
10891 for val in &self.puk {
10892 __tmp.put_u8(*val);
10893 }
10894 __tmp.put_u8(self.roaming);
10895 __tmp.put_u8(self.response as u8);
10896 if matches!(version, MavlinkVersion::V2) {
10897 let len = __tmp.len();
10898 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10899 } else {
10900 __tmp.len()
10901 }
10902 }
10903}
10904#[doc = "id: 27"]
10905#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
10906#[derive(Debug, Clone, PartialEq)]
10907#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10908#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10909pub struct RAW_IMU_DATA {
10910 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10911 pub time_usec: u64,
10912 #[doc = "X acceleration (raw)"]
10913 pub xacc: i16,
10914 #[doc = "Y acceleration (raw)"]
10915 pub yacc: i16,
10916 #[doc = "Z acceleration (raw)"]
10917 pub zacc: i16,
10918 #[doc = "Angular speed around X axis (raw)"]
10919 pub xgyro: i16,
10920 #[doc = "Angular speed around Y axis (raw)"]
10921 pub ygyro: i16,
10922 #[doc = "Angular speed around Z axis (raw)"]
10923 pub zgyro: i16,
10924 #[doc = "X Magnetic field (raw)"]
10925 pub xmag: i16,
10926 #[doc = "Y Magnetic field (raw)"]
10927 pub ymag: i16,
10928 #[doc = "Z Magnetic field (raw)"]
10929 pub zmag: i16,
10930 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
10931 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10932 pub id: u8,
10933 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
10934 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10935 pub temperature: i16,
10936}
10937impl RAW_IMU_DATA {
10938 pub const ENCODED_LEN: usize = 29usize;
10939 pub const DEFAULT: Self = Self {
10940 time_usec: 0_u64,
10941 xacc: 0_i16,
10942 yacc: 0_i16,
10943 zacc: 0_i16,
10944 xgyro: 0_i16,
10945 ygyro: 0_i16,
10946 zgyro: 0_i16,
10947 xmag: 0_i16,
10948 ymag: 0_i16,
10949 zmag: 0_i16,
10950 id: 0_u8,
10951 temperature: 0_i16,
10952 };
10953 #[cfg(feature = "arbitrary")]
10954 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10955 use arbitrary::{Arbitrary, Unstructured};
10956 let mut buf = [0u8; 1024];
10957 rng.fill_bytes(&mut buf);
10958 let mut unstructured = Unstructured::new(&buf);
10959 Self::arbitrary(&mut unstructured).unwrap_or_default()
10960 }
10961}
10962impl Default for RAW_IMU_DATA {
10963 fn default() -> Self {
10964 Self::DEFAULT.clone()
10965 }
10966}
10967impl MessageData for RAW_IMU_DATA {
10968 type Message = MavMessage;
10969 const ID: u32 = 27u32;
10970 const NAME: &'static str = "RAW_IMU";
10971 const EXTRA_CRC: u8 = 144u8;
10972 const ENCODED_LEN: usize = 29usize;
10973 fn deser(
10974 _version: MavlinkVersion,
10975 __input: &[u8],
10976 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10977 let avail_len = __input.len();
10978 let mut payload_buf = [0; Self::ENCODED_LEN];
10979 let mut buf = if avail_len < Self::ENCODED_LEN {
10980 payload_buf[0..avail_len].copy_from_slice(__input);
10981 Bytes::new(&payload_buf)
10982 } else {
10983 Bytes::new(__input)
10984 };
10985 let mut __struct = Self::default();
10986 __struct.time_usec = buf.get_u64_le();
10987 __struct.xacc = buf.get_i16_le();
10988 __struct.yacc = buf.get_i16_le();
10989 __struct.zacc = buf.get_i16_le();
10990 __struct.xgyro = buf.get_i16_le();
10991 __struct.ygyro = buf.get_i16_le();
10992 __struct.zgyro = buf.get_i16_le();
10993 __struct.xmag = buf.get_i16_le();
10994 __struct.ymag = buf.get_i16_le();
10995 __struct.zmag = buf.get_i16_le();
10996 __struct.id = buf.get_u8();
10997 __struct.temperature = buf.get_i16_le();
10998 Ok(__struct)
10999 }
11000 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11001 let mut __tmp = BytesMut::new(bytes);
11002 #[allow(clippy::absurd_extreme_comparisons)]
11003 #[allow(unused_comparisons)]
11004 if __tmp.remaining() < Self::ENCODED_LEN {
11005 panic!(
11006 "buffer is too small (need {} bytes, but got {})",
11007 Self::ENCODED_LEN,
11008 __tmp.remaining(),
11009 )
11010 }
11011 __tmp.put_u64_le(self.time_usec);
11012 __tmp.put_i16_le(self.xacc);
11013 __tmp.put_i16_le(self.yacc);
11014 __tmp.put_i16_le(self.zacc);
11015 __tmp.put_i16_le(self.xgyro);
11016 __tmp.put_i16_le(self.ygyro);
11017 __tmp.put_i16_le(self.zgyro);
11018 __tmp.put_i16_le(self.xmag);
11019 __tmp.put_i16_le(self.ymag);
11020 __tmp.put_i16_le(self.zmag);
11021 __tmp.put_u8(self.id);
11022 __tmp.put_i16_le(self.temperature);
11023 if matches!(version, MavlinkVersion::V2) {
11024 let len = __tmp.len();
11025 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11026 } else {
11027 __tmp.len()
11028 }
11029 }
11030}
11031#[doc = "id: 12902"]
11032#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
11033#[derive(Debug, Clone, PartialEq)]
11034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11035#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11036pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
11037 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
11038 pub timestamp: u32,
11039 #[doc = "System ID (0 for broadcast)."]
11040 pub target_system: u8,
11041 #[doc = "Component ID (0 for broadcast)."]
11042 pub target_component: u8,
11043 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
11044 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11045 pub id_or_mac: [u8; 20],
11046 #[doc = "Indicates the type of authentication."]
11047 pub authentication_type: MavOdidAuthType,
11048 #[doc = "Allowed range is 0 - 15."]
11049 pub data_page: u8,
11050 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
11051 pub last_page_index: u8,
11052 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
11053 pub length: u8,
11054 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
11055 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11056 pub authentication_data: [u8; 23],
11057}
11058impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
11059 pub const ENCODED_LEN: usize = 53usize;
11060 pub const DEFAULT: Self = Self {
11061 timestamp: 0_u32,
11062 target_system: 0_u8,
11063 target_component: 0_u8,
11064 id_or_mac: [0_u8; 20usize],
11065 authentication_type: MavOdidAuthType::DEFAULT,
11066 data_page: 0_u8,
11067 last_page_index: 0_u8,
11068 length: 0_u8,
11069 authentication_data: [0_u8; 23usize],
11070 };
11071 #[cfg(feature = "arbitrary")]
11072 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11073 use arbitrary::{Arbitrary, Unstructured};
11074 let mut buf = [0u8; 1024];
11075 rng.fill_bytes(&mut buf);
11076 let mut unstructured = Unstructured::new(&buf);
11077 Self::arbitrary(&mut unstructured).unwrap_or_default()
11078 }
11079}
11080impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
11081 fn default() -> Self {
11082 Self::DEFAULT.clone()
11083 }
11084}
11085impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
11086 type Message = MavMessage;
11087 const ID: u32 = 12902u32;
11088 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
11089 const EXTRA_CRC: u8 = 140u8;
11090 const ENCODED_LEN: usize = 53usize;
11091 fn deser(
11092 _version: MavlinkVersion,
11093 __input: &[u8],
11094 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11095 let avail_len = __input.len();
11096 let mut payload_buf = [0; Self::ENCODED_LEN];
11097 let mut buf = if avail_len < Self::ENCODED_LEN {
11098 payload_buf[0..avail_len].copy_from_slice(__input);
11099 Bytes::new(&payload_buf)
11100 } else {
11101 Bytes::new(__input)
11102 };
11103 let mut __struct = Self::default();
11104 __struct.timestamp = buf.get_u32_le();
11105 __struct.target_system = buf.get_u8();
11106 __struct.target_component = buf.get_u8();
11107 for v in &mut __struct.id_or_mac {
11108 let val = buf.get_u8();
11109 *v = val;
11110 }
11111 let tmp = buf.get_u8();
11112 __struct.authentication_type =
11113 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11114 enum_type: "MavOdidAuthType",
11115 value: tmp as u32,
11116 })?;
11117 __struct.data_page = buf.get_u8();
11118 __struct.last_page_index = buf.get_u8();
11119 __struct.length = buf.get_u8();
11120 for v in &mut __struct.authentication_data {
11121 let val = buf.get_u8();
11122 *v = val;
11123 }
11124 Ok(__struct)
11125 }
11126 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11127 let mut __tmp = BytesMut::new(bytes);
11128 #[allow(clippy::absurd_extreme_comparisons)]
11129 #[allow(unused_comparisons)]
11130 if __tmp.remaining() < Self::ENCODED_LEN {
11131 panic!(
11132 "buffer is too small (need {} bytes, but got {})",
11133 Self::ENCODED_LEN,
11134 __tmp.remaining(),
11135 )
11136 }
11137 __tmp.put_u32_le(self.timestamp);
11138 __tmp.put_u8(self.target_system);
11139 __tmp.put_u8(self.target_component);
11140 for val in &self.id_or_mac {
11141 __tmp.put_u8(*val);
11142 }
11143 __tmp.put_u8(self.authentication_type as u8);
11144 __tmp.put_u8(self.data_page);
11145 __tmp.put_u8(self.last_page_index);
11146 __tmp.put_u8(self.length);
11147 for val in &self.authentication_data {
11148 __tmp.put_u8(*val);
11149 }
11150 if matches!(version, MavlinkVersion::V2) {
11151 let len = __tmp.len();
11152 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11153 } else {
11154 __tmp.len()
11155 }
11156 }
11157}
11158#[doc = "id: 130"]
11159#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
11160#[derive(Debug, Clone, PartialEq)]
11161#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11162#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11163pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
11164 #[doc = "total data size (set on ACK only)."]
11165 pub size: u32,
11166 #[doc = "Width of a matrix or image."]
11167 pub width: u16,
11168 #[doc = "Height of a matrix or image."]
11169 pub height: u16,
11170 #[doc = "Number of packets being sent (set on ACK only)."]
11171 pub packets: u16,
11172 #[doc = "Type of requested/acknowledged data."]
11173 pub mavtype: MavlinkDataStreamType,
11174 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
11175 pub payload: u8,
11176 #[doc = "JPEG quality. Values: [1-100]."]
11177 pub jpg_quality: u8,
11178}
11179impl DATA_TRANSMISSION_HANDSHAKE_DATA {
11180 pub const ENCODED_LEN: usize = 13usize;
11181 pub const DEFAULT: Self = Self {
11182 size: 0_u32,
11183 width: 0_u16,
11184 height: 0_u16,
11185 packets: 0_u16,
11186 mavtype: MavlinkDataStreamType::DEFAULT,
11187 payload: 0_u8,
11188 jpg_quality: 0_u8,
11189 };
11190 #[cfg(feature = "arbitrary")]
11191 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11192 use arbitrary::{Arbitrary, Unstructured};
11193 let mut buf = [0u8; 1024];
11194 rng.fill_bytes(&mut buf);
11195 let mut unstructured = Unstructured::new(&buf);
11196 Self::arbitrary(&mut unstructured).unwrap_or_default()
11197 }
11198}
11199impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
11200 fn default() -> Self {
11201 Self::DEFAULT.clone()
11202 }
11203}
11204impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
11205 type Message = MavMessage;
11206 const ID: u32 = 130u32;
11207 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
11208 const EXTRA_CRC: u8 = 29u8;
11209 const ENCODED_LEN: usize = 13usize;
11210 fn deser(
11211 _version: MavlinkVersion,
11212 __input: &[u8],
11213 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11214 let avail_len = __input.len();
11215 let mut payload_buf = [0; Self::ENCODED_LEN];
11216 let mut buf = if avail_len < Self::ENCODED_LEN {
11217 payload_buf[0..avail_len].copy_from_slice(__input);
11218 Bytes::new(&payload_buf)
11219 } else {
11220 Bytes::new(__input)
11221 };
11222 let mut __struct = Self::default();
11223 __struct.size = buf.get_u32_le();
11224 __struct.width = buf.get_u16_le();
11225 __struct.height = buf.get_u16_le();
11226 __struct.packets = buf.get_u16_le();
11227 let tmp = buf.get_u8();
11228 __struct.mavtype =
11229 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11230 enum_type: "MavlinkDataStreamType",
11231 value: tmp as u32,
11232 })?;
11233 __struct.payload = buf.get_u8();
11234 __struct.jpg_quality = buf.get_u8();
11235 Ok(__struct)
11236 }
11237 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11238 let mut __tmp = BytesMut::new(bytes);
11239 #[allow(clippy::absurd_extreme_comparisons)]
11240 #[allow(unused_comparisons)]
11241 if __tmp.remaining() < Self::ENCODED_LEN {
11242 panic!(
11243 "buffer is too small (need {} bytes, but got {})",
11244 Self::ENCODED_LEN,
11245 __tmp.remaining(),
11246 )
11247 }
11248 __tmp.put_u32_le(self.size);
11249 __tmp.put_u16_le(self.width);
11250 __tmp.put_u16_le(self.height);
11251 __tmp.put_u16_le(self.packets);
11252 __tmp.put_u8(self.mavtype as u8);
11253 __tmp.put_u8(self.payload);
11254 __tmp.put_u8(self.jpg_quality);
11255 if matches!(version, MavlinkVersion::V2) {
11256 let len = __tmp.len();
11257 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11258 } else {
11259 __tmp.len()
11260 }
11261 }
11262}
11263#[doc = "id: 122"]
11264#[doc = "Stop log transfer and resume normal logging."]
11265#[derive(Debug, Clone, PartialEq)]
11266#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11267#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11268pub struct LOG_REQUEST_END_DATA {
11269 #[doc = "System ID"]
11270 pub target_system: u8,
11271 #[doc = "Component ID"]
11272 pub target_component: u8,
11273}
11274impl LOG_REQUEST_END_DATA {
11275 pub const ENCODED_LEN: usize = 2usize;
11276 pub const DEFAULT: Self = Self {
11277 target_system: 0_u8,
11278 target_component: 0_u8,
11279 };
11280 #[cfg(feature = "arbitrary")]
11281 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11282 use arbitrary::{Arbitrary, Unstructured};
11283 let mut buf = [0u8; 1024];
11284 rng.fill_bytes(&mut buf);
11285 let mut unstructured = Unstructured::new(&buf);
11286 Self::arbitrary(&mut unstructured).unwrap_or_default()
11287 }
11288}
11289impl Default for LOG_REQUEST_END_DATA {
11290 fn default() -> Self {
11291 Self::DEFAULT.clone()
11292 }
11293}
11294impl MessageData for LOG_REQUEST_END_DATA {
11295 type Message = MavMessage;
11296 const ID: u32 = 122u32;
11297 const NAME: &'static str = "LOG_REQUEST_END";
11298 const EXTRA_CRC: u8 = 203u8;
11299 const ENCODED_LEN: usize = 2usize;
11300 fn deser(
11301 _version: MavlinkVersion,
11302 __input: &[u8],
11303 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11304 let avail_len = __input.len();
11305 let mut payload_buf = [0; Self::ENCODED_LEN];
11306 let mut buf = if avail_len < Self::ENCODED_LEN {
11307 payload_buf[0..avail_len].copy_from_slice(__input);
11308 Bytes::new(&payload_buf)
11309 } else {
11310 Bytes::new(__input)
11311 };
11312 let mut __struct = Self::default();
11313 __struct.target_system = buf.get_u8();
11314 __struct.target_component = buf.get_u8();
11315 Ok(__struct)
11316 }
11317 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11318 let mut __tmp = BytesMut::new(bytes);
11319 #[allow(clippy::absurd_extreme_comparisons)]
11320 #[allow(unused_comparisons)]
11321 if __tmp.remaining() < Self::ENCODED_LEN {
11322 panic!(
11323 "buffer is too small (need {} bytes, but got {})",
11324 Self::ENCODED_LEN,
11325 __tmp.remaining(),
11326 )
11327 }
11328 __tmp.put_u8(self.target_system);
11329 __tmp.put_u8(self.target_component);
11330 if matches!(version, MavlinkVersion::V2) {
11331 let len = __tmp.len();
11332 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11333 } else {
11334 __tmp.len()
11335 }
11336 }
11337}
11338#[doc = "id: 86"]
11339#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
11340#[derive(Debug, Clone, PartialEq)]
11341#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11342#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11343pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
11344 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
11345 pub time_boot_ms: u32,
11346 #[doc = "Latitude in WGS84 frame"]
11347 pub lat_int: i32,
11348 #[doc = "Longitude in WGS84 frame"]
11349 pub lon_int: i32,
11350 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
11351 pub alt: f32,
11352 #[doc = "X velocity in NED frame"]
11353 pub vx: f32,
11354 #[doc = "Y velocity in NED frame"]
11355 pub vy: f32,
11356 #[doc = "Z velocity in NED frame"]
11357 pub vz: f32,
11358 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
11359 pub afx: f32,
11360 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
11361 pub afy: f32,
11362 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
11363 pub afz: f32,
11364 #[doc = "yaw setpoint"]
11365 pub yaw: f32,
11366 #[doc = "yaw rate setpoint"]
11367 pub yaw_rate: f32,
11368 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
11369 pub type_mask: PositionTargetTypemask,
11370 #[doc = "System ID"]
11371 pub target_system: u8,
11372 #[doc = "Component ID"]
11373 pub target_component: u8,
11374 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
11375 pub coordinate_frame: MavFrame,
11376}
11377impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
11378 pub const ENCODED_LEN: usize = 53usize;
11379 pub const DEFAULT: Self = Self {
11380 time_boot_ms: 0_u32,
11381 lat_int: 0_i32,
11382 lon_int: 0_i32,
11383 alt: 0.0_f32,
11384 vx: 0.0_f32,
11385 vy: 0.0_f32,
11386 vz: 0.0_f32,
11387 afx: 0.0_f32,
11388 afy: 0.0_f32,
11389 afz: 0.0_f32,
11390 yaw: 0.0_f32,
11391 yaw_rate: 0.0_f32,
11392 type_mask: PositionTargetTypemask::DEFAULT,
11393 target_system: 0_u8,
11394 target_component: 0_u8,
11395 coordinate_frame: MavFrame::DEFAULT,
11396 };
11397 #[cfg(feature = "arbitrary")]
11398 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11399 use arbitrary::{Arbitrary, Unstructured};
11400 let mut buf = [0u8; 1024];
11401 rng.fill_bytes(&mut buf);
11402 let mut unstructured = Unstructured::new(&buf);
11403 Self::arbitrary(&mut unstructured).unwrap_or_default()
11404 }
11405}
11406impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
11407 fn default() -> Self {
11408 Self::DEFAULT.clone()
11409 }
11410}
11411impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
11412 type Message = MavMessage;
11413 const ID: u32 = 86u32;
11414 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
11415 const EXTRA_CRC: u8 = 5u8;
11416 const ENCODED_LEN: usize = 53usize;
11417 fn deser(
11418 _version: MavlinkVersion,
11419 __input: &[u8],
11420 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11421 let avail_len = __input.len();
11422 let mut payload_buf = [0; Self::ENCODED_LEN];
11423 let mut buf = if avail_len < Self::ENCODED_LEN {
11424 payload_buf[0..avail_len].copy_from_slice(__input);
11425 Bytes::new(&payload_buf)
11426 } else {
11427 Bytes::new(__input)
11428 };
11429 let mut __struct = Self::default();
11430 __struct.time_boot_ms = buf.get_u32_le();
11431 __struct.lat_int = buf.get_i32_le();
11432 __struct.lon_int = buf.get_i32_le();
11433 __struct.alt = buf.get_f32_le();
11434 __struct.vx = buf.get_f32_le();
11435 __struct.vy = buf.get_f32_le();
11436 __struct.vz = buf.get_f32_le();
11437 __struct.afx = buf.get_f32_le();
11438 __struct.afy = buf.get_f32_le();
11439 __struct.afz = buf.get_f32_le();
11440 __struct.yaw = buf.get_f32_le();
11441 __struct.yaw_rate = buf.get_f32_le();
11442 let tmp = buf.get_u16_le();
11443 __struct.type_mask = PositionTargetTypemask::from_bits(
11444 tmp & PositionTargetTypemask::all().bits(),
11445 )
11446 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11447 flag_type: "PositionTargetTypemask",
11448 value: tmp as u32,
11449 })?;
11450 __struct.target_system = buf.get_u8();
11451 __struct.target_component = buf.get_u8();
11452 let tmp = buf.get_u8();
11453 __struct.coordinate_frame =
11454 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11455 enum_type: "MavFrame",
11456 value: tmp as u32,
11457 })?;
11458 Ok(__struct)
11459 }
11460 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11461 let mut __tmp = BytesMut::new(bytes);
11462 #[allow(clippy::absurd_extreme_comparisons)]
11463 #[allow(unused_comparisons)]
11464 if __tmp.remaining() < Self::ENCODED_LEN {
11465 panic!(
11466 "buffer is too small (need {} bytes, but got {})",
11467 Self::ENCODED_LEN,
11468 __tmp.remaining(),
11469 )
11470 }
11471 __tmp.put_u32_le(self.time_boot_ms);
11472 __tmp.put_i32_le(self.lat_int);
11473 __tmp.put_i32_le(self.lon_int);
11474 __tmp.put_f32_le(self.alt);
11475 __tmp.put_f32_le(self.vx);
11476 __tmp.put_f32_le(self.vy);
11477 __tmp.put_f32_le(self.vz);
11478 __tmp.put_f32_le(self.afx);
11479 __tmp.put_f32_le(self.afy);
11480 __tmp.put_f32_le(self.afz);
11481 __tmp.put_f32_le(self.yaw);
11482 __tmp.put_f32_le(self.yaw_rate);
11483 __tmp.put_u16_le(self.type_mask.bits());
11484 __tmp.put_u8(self.target_system);
11485 __tmp.put_u8(self.target_component);
11486 __tmp.put_u8(self.coordinate_frame as u8);
11487 if matches!(version, MavlinkVersion::V2) {
11488 let len = __tmp.len();
11489 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11490 } else {
11491 __tmp.len()
11492 }
11493 }
11494}
11495#[doc = "id: 74"]
11496#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
11497#[derive(Debug, Clone, PartialEq)]
11498#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11499#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11500pub struct VFR_HUD_DATA {
11501 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
11502 pub airspeed: f32,
11503 #[doc = "Current ground speed."]
11504 pub groundspeed: f32,
11505 #[doc = "Current altitude (MSL)."]
11506 pub alt: f32,
11507 #[doc = "Current climb rate."]
11508 pub climb: f32,
11509 #[doc = "Current heading in compass units (0-360, 0=north)."]
11510 pub heading: i16,
11511 #[doc = "Current throttle setting (0 to 100)."]
11512 pub throttle: u16,
11513}
11514impl VFR_HUD_DATA {
11515 pub const ENCODED_LEN: usize = 20usize;
11516 pub const DEFAULT: Self = Self {
11517 airspeed: 0.0_f32,
11518 groundspeed: 0.0_f32,
11519 alt: 0.0_f32,
11520 climb: 0.0_f32,
11521 heading: 0_i16,
11522 throttle: 0_u16,
11523 };
11524 #[cfg(feature = "arbitrary")]
11525 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11526 use arbitrary::{Arbitrary, Unstructured};
11527 let mut buf = [0u8; 1024];
11528 rng.fill_bytes(&mut buf);
11529 let mut unstructured = Unstructured::new(&buf);
11530 Self::arbitrary(&mut unstructured).unwrap_or_default()
11531 }
11532}
11533impl Default for VFR_HUD_DATA {
11534 fn default() -> Self {
11535 Self::DEFAULT.clone()
11536 }
11537}
11538impl MessageData for VFR_HUD_DATA {
11539 type Message = MavMessage;
11540 const ID: u32 = 74u32;
11541 const NAME: &'static str = "VFR_HUD";
11542 const EXTRA_CRC: u8 = 20u8;
11543 const ENCODED_LEN: usize = 20usize;
11544 fn deser(
11545 _version: MavlinkVersion,
11546 __input: &[u8],
11547 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11548 let avail_len = __input.len();
11549 let mut payload_buf = [0; Self::ENCODED_LEN];
11550 let mut buf = if avail_len < Self::ENCODED_LEN {
11551 payload_buf[0..avail_len].copy_from_slice(__input);
11552 Bytes::new(&payload_buf)
11553 } else {
11554 Bytes::new(__input)
11555 };
11556 let mut __struct = Self::default();
11557 __struct.airspeed = buf.get_f32_le();
11558 __struct.groundspeed = buf.get_f32_le();
11559 __struct.alt = buf.get_f32_le();
11560 __struct.climb = buf.get_f32_le();
11561 __struct.heading = buf.get_i16_le();
11562 __struct.throttle = buf.get_u16_le();
11563 Ok(__struct)
11564 }
11565 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11566 let mut __tmp = BytesMut::new(bytes);
11567 #[allow(clippy::absurd_extreme_comparisons)]
11568 #[allow(unused_comparisons)]
11569 if __tmp.remaining() < Self::ENCODED_LEN {
11570 panic!(
11571 "buffer is too small (need {} bytes, but got {})",
11572 Self::ENCODED_LEN,
11573 __tmp.remaining(),
11574 )
11575 }
11576 __tmp.put_f32_le(self.airspeed);
11577 __tmp.put_f32_le(self.groundspeed);
11578 __tmp.put_f32_le(self.alt);
11579 __tmp.put_f32_le(self.climb);
11580 __tmp.put_i16_le(self.heading);
11581 __tmp.put_u16_le(self.throttle);
11582 if matches!(version, MavlinkVersion::V2) {
11583 let len = __tmp.len();
11584 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11585 } else {
11586 __tmp.len()
11587 }
11588 }
11589}
11590#[doc = "id: 6"]
11591#[doc = "Accept / deny control of this MAV."]
11592#[derive(Debug, Clone, PartialEq)]
11593#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11594#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11595pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
11596 #[doc = "ID of the GCS this message"]
11597 pub gcs_system_id: u8,
11598 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
11599 pub control_request: u8,
11600 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
11601 pub ack: u8,
11602}
11603impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
11604 pub const ENCODED_LEN: usize = 3usize;
11605 pub const DEFAULT: Self = Self {
11606 gcs_system_id: 0_u8,
11607 control_request: 0_u8,
11608 ack: 0_u8,
11609 };
11610 #[cfg(feature = "arbitrary")]
11611 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11612 use arbitrary::{Arbitrary, Unstructured};
11613 let mut buf = [0u8; 1024];
11614 rng.fill_bytes(&mut buf);
11615 let mut unstructured = Unstructured::new(&buf);
11616 Self::arbitrary(&mut unstructured).unwrap_or_default()
11617 }
11618}
11619impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
11620 fn default() -> Self {
11621 Self::DEFAULT.clone()
11622 }
11623}
11624impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
11625 type Message = MavMessage;
11626 const ID: u32 = 6u32;
11627 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
11628 const EXTRA_CRC: u8 = 104u8;
11629 const ENCODED_LEN: usize = 3usize;
11630 fn deser(
11631 _version: MavlinkVersion,
11632 __input: &[u8],
11633 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11634 let avail_len = __input.len();
11635 let mut payload_buf = [0; Self::ENCODED_LEN];
11636 let mut buf = if avail_len < Self::ENCODED_LEN {
11637 payload_buf[0..avail_len].copy_from_slice(__input);
11638 Bytes::new(&payload_buf)
11639 } else {
11640 Bytes::new(__input)
11641 };
11642 let mut __struct = Self::default();
11643 __struct.gcs_system_id = buf.get_u8();
11644 __struct.control_request = buf.get_u8();
11645 __struct.ack = buf.get_u8();
11646 Ok(__struct)
11647 }
11648 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11649 let mut __tmp = BytesMut::new(bytes);
11650 #[allow(clippy::absurd_extreme_comparisons)]
11651 #[allow(unused_comparisons)]
11652 if __tmp.remaining() < Self::ENCODED_LEN {
11653 panic!(
11654 "buffer is too small (need {} bytes, but got {})",
11655 Self::ENCODED_LEN,
11656 __tmp.remaining(),
11657 )
11658 }
11659 __tmp.put_u8(self.gcs_system_id);
11660 __tmp.put_u8(self.control_request);
11661 __tmp.put_u8(self.ack);
11662 if matches!(version, MavlinkVersion::V2) {
11663 let len = __tmp.len();
11664 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11665 } else {
11666 __tmp.len()
11667 }
11668 }
11669}
11670#[doc = "id: 9005"]
11671#[doc = "Winch status."]
11672#[derive(Debug, Clone, PartialEq)]
11673#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11674#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11675pub struct WINCH_STATUS_DATA {
11676 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
11677 pub time_usec: u64,
11678 #[doc = "Length of line released. NaN if unknown"]
11679 pub line_length: f32,
11680 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
11681 pub speed: f32,
11682 #[doc = "Tension on the line. NaN if unknown"]
11683 pub tension: f32,
11684 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
11685 pub voltage: f32,
11686 #[doc = "Current draw from the winch. NaN if unknown"]
11687 pub current: f32,
11688 #[doc = "Status flags"]
11689 pub status: MavWinchStatusFlag,
11690 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
11691 pub temperature: i16,
11692}
11693impl WINCH_STATUS_DATA {
11694 pub const ENCODED_LEN: usize = 34usize;
11695 pub const DEFAULT: Self = Self {
11696 time_usec: 0_u64,
11697 line_length: 0.0_f32,
11698 speed: 0.0_f32,
11699 tension: 0.0_f32,
11700 voltage: 0.0_f32,
11701 current: 0.0_f32,
11702 status: MavWinchStatusFlag::DEFAULT,
11703 temperature: 0_i16,
11704 };
11705 #[cfg(feature = "arbitrary")]
11706 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11707 use arbitrary::{Arbitrary, Unstructured};
11708 let mut buf = [0u8; 1024];
11709 rng.fill_bytes(&mut buf);
11710 let mut unstructured = Unstructured::new(&buf);
11711 Self::arbitrary(&mut unstructured).unwrap_or_default()
11712 }
11713}
11714impl Default for WINCH_STATUS_DATA {
11715 fn default() -> Self {
11716 Self::DEFAULT.clone()
11717 }
11718}
11719impl MessageData for WINCH_STATUS_DATA {
11720 type Message = MavMessage;
11721 const ID: u32 = 9005u32;
11722 const NAME: &'static str = "WINCH_STATUS";
11723 const EXTRA_CRC: u8 = 117u8;
11724 const ENCODED_LEN: usize = 34usize;
11725 fn deser(
11726 _version: MavlinkVersion,
11727 __input: &[u8],
11728 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11729 let avail_len = __input.len();
11730 let mut payload_buf = [0; Self::ENCODED_LEN];
11731 let mut buf = if avail_len < Self::ENCODED_LEN {
11732 payload_buf[0..avail_len].copy_from_slice(__input);
11733 Bytes::new(&payload_buf)
11734 } else {
11735 Bytes::new(__input)
11736 };
11737 let mut __struct = Self::default();
11738 __struct.time_usec = buf.get_u64_le();
11739 __struct.line_length = buf.get_f32_le();
11740 __struct.speed = buf.get_f32_le();
11741 __struct.tension = buf.get_f32_le();
11742 __struct.voltage = buf.get_f32_le();
11743 __struct.current = buf.get_f32_le();
11744 let tmp = buf.get_u32_le();
11745 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
11746 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11747 flag_type: "MavWinchStatusFlag",
11748 value: tmp as u32,
11749 })?;
11750 __struct.temperature = buf.get_i16_le();
11751 Ok(__struct)
11752 }
11753 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11754 let mut __tmp = BytesMut::new(bytes);
11755 #[allow(clippy::absurd_extreme_comparisons)]
11756 #[allow(unused_comparisons)]
11757 if __tmp.remaining() < Self::ENCODED_LEN {
11758 panic!(
11759 "buffer is too small (need {} bytes, but got {})",
11760 Self::ENCODED_LEN,
11761 __tmp.remaining(),
11762 )
11763 }
11764 __tmp.put_u64_le(self.time_usec);
11765 __tmp.put_f32_le(self.line_length);
11766 __tmp.put_f32_le(self.speed);
11767 __tmp.put_f32_le(self.tension);
11768 __tmp.put_f32_le(self.voltage);
11769 __tmp.put_f32_le(self.current);
11770 __tmp.put_u32_le(self.status.bits());
11771 __tmp.put_i16_le(self.temperature);
11772 if matches!(version, MavlinkVersion::V2) {
11773 let len = __tmp.len();
11774 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11775 } else {
11776 __tmp.len()
11777 }
11778 }
11779}
11780#[doc = "id: 290"]
11781#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11782#[derive(Debug, Clone, PartialEq)]
11783#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11784#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11785pub struct ESC_INFO_DATA {
11786 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11787 pub time_usec: u64,
11788 #[doc = "Number of reported errors by each ESC since boot."]
11789 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11790 pub error_count: [u32; 4],
11791 #[doc = "Counter of data packets received."]
11792 pub counter: u16,
11793 #[doc = "Bitmap of ESC failure flags."]
11794 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11795 pub failure_flags: [u16; 4],
11796 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11797 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11798 pub temperature: [i16; 4],
11799 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11800 pub index: u8,
11801 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11802 pub count: u8,
11803 #[doc = "Connection type protocol for all ESC."]
11804 pub connection_type: EscConnectionType,
11805 #[doc = "Information regarding online/offline status of each ESC."]
11806 pub info: u8,
11807}
11808impl ESC_INFO_DATA {
11809 pub const ENCODED_LEN: usize = 46usize;
11810 pub const DEFAULT: Self = Self {
11811 time_usec: 0_u64,
11812 error_count: [0_u32; 4usize],
11813 counter: 0_u16,
11814 failure_flags: [0_u16; 4usize],
11815 temperature: [0_i16; 4usize],
11816 index: 0_u8,
11817 count: 0_u8,
11818 connection_type: EscConnectionType::DEFAULT,
11819 info: 0_u8,
11820 };
11821 #[cfg(feature = "arbitrary")]
11822 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11823 use arbitrary::{Arbitrary, Unstructured};
11824 let mut buf = [0u8; 1024];
11825 rng.fill_bytes(&mut buf);
11826 let mut unstructured = Unstructured::new(&buf);
11827 Self::arbitrary(&mut unstructured).unwrap_or_default()
11828 }
11829}
11830impl Default for ESC_INFO_DATA {
11831 fn default() -> Self {
11832 Self::DEFAULT.clone()
11833 }
11834}
11835impl MessageData for ESC_INFO_DATA {
11836 type Message = MavMessage;
11837 const ID: u32 = 290u32;
11838 const NAME: &'static str = "ESC_INFO";
11839 const EXTRA_CRC: u8 = 251u8;
11840 const ENCODED_LEN: usize = 46usize;
11841 fn deser(
11842 _version: MavlinkVersion,
11843 __input: &[u8],
11844 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11845 let avail_len = __input.len();
11846 let mut payload_buf = [0; Self::ENCODED_LEN];
11847 let mut buf = if avail_len < Self::ENCODED_LEN {
11848 payload_buf[0..avail_len].copy_from_slice(__input);
11849 Bytes::new(&payload_buf)
11850 } else {
11851 Bytes::new(__input)
11852 };
11853 let mut __struct = Self::default();
11854 __struct.time_usec = buf.get_u64_le();
11855 for v in &mut __struct.error_count {
11856 let val = buf.get_u32_le();
11857 *v = val;
11858 }
11859 __struct.counter = buf.get_u16_le();
11860 for v in &mut __struct.failure_flags {
11861 let val = buf.get_u16_le();
11862 *v = val;
11863 }
11864 for v in &mut __struct.temperature {
11865 let val = buf.get_i16_le();
11866 *v = val;
11867 }
11868 __struct.index = buf.get_u8();
11869 __struct.count = buf.get_u8();
11870 let tmp = buf.get_u8();
11871 __struct.connection_type =
11872 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11873 enum_type: "EscConnectionType",
11874 value: tmp as u32,
11875 })?;
11876 __struct.info = buf.get_u8();
11877 Ok(__struct)
11878 }
11879 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11880 let mut __tmp = BytesMut::new(bytes);
11881 #[allow(clippy::absurd_extreme_comparisons)]
11882 #[allow(unused_comparisons)]
11883 if __tmp.remaining() < Self::ENCODED_LEN {
11884 panic!(
11885 "buffer is too small (need {} bytes, but got {})",
11886 Self::ENCODED_LEN,
11887 __tmp.remaining(),
11888 )
11889 }
11890 __tmp.put_u64_le(self.time_usec);
11891 for val in &self.error_count {
11892 __tmp.put_u32_le(*val);
11893 }
11894 __tmp.put_u16_le(self.counter);
11895 for val in &self.failure_flags {
11896 __tmp.put_u16_le(*val);
11897 }
11898 for val in &self.temperature {
11899 __tmp.put_i16_le(*val);
11900 }
11901 __tmp.put_u8(self.index);
11902 __tmp.put_u8(self.count);
11903 __tmp.put_u8(self.connection_type as u8);
11904 __tmp.put_u8(self.info);
11905 if matches!(version, MavlinkVersion::V2) {
11906 let len = __tmp.len();
11907 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11908 } else {
11909 __tmp.len()
11910 }
11911 }
11912}
11913#[doc = "id: 60050"]
11914#[doc = "AVSS PRS system status."]
11915#[derive(Debug, Clone, PartialEq)]
11916#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11917#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11918pub struct AVSS_PRS_SYS_STATUS_DATA {
11919 #[doc = "Timestamp (time since PRS boot)."]
11920 pub time_boot_ms: u32,
11921 #[doc = "PRS error statuses"]
11922 pub error_status: u32,
11923 #[doc = "Estimated battery run-time without a remote connection and PRS battery voltage"]
11924 pub battery_status: u32,
11925 #[doc = "PRS arm statuses"]
11926 pub arm_status: u8,
11927 #[doc = "PRS battery charge statuses"]
11928 pub charge_status: u8,
11929}
11930impl AVSS_PRS_SYS_STATUS_DATA {
11931 pub const ENCODED_LEN: usize = 14usize;
11932 pub const DEFAULT: Self = Self {
11933 time_boot_ms: 0_u32,
11934 error_status: 0_u32,
11935 battery_status: 0_u32,
11936 arm_status: 0_u8,
11937 charge_status: 0_u8,
11938 };
11939 #[cfg(feature = "arbitrary")]
11940 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11941 use arbitrary::{Arbitrary, Unstructured};
11942 let mut buf = [0u8; 1024];
11943 rng.fill_bytes(&mut buf);
11944 let mut unstructured = Unstructured::new(&buf);
11945 Self::arbitrary(&mut unstructured).unwrap_or_default()
11946 }
11947}
11948impl Default for AVSS_PRS_SYS_STATUS_DATA {
11949 fn default() -> Self {
11950 Self::DEFAULT.clone()
11951 }
11952}
11953impl MessageData for AVSS_PRS_SYS_STATUS_DATA {
11954 type Message = MavMessage;
11955 const ID: u32 = 60050u32;
11956 const NAME: &'static str = "AVSS_PRS_SYS_STATUS";
11957 const EXTRA_CRC: u8 = 220u8;
11958 const ENCODED_LEN: usize = 14usize;
11959 fn deser(
11960 _version: MavlinkVersion,
11961 __input: &[u8],
11962 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11963 let avail_len = __input.len();
11964 let mut payload_buf = [0; Self::ENCODED_LEN];
11965 let mut buf = if avail_len < Self::ENCODED_LEN {
11966 payload_buf[0..avail_len].copy_from_slice(__input);
11967 Bytes::new(&payload_buf)
11968 } else {
11969 Bytes::new(__input)
11970 };
11971 let mut __struct = Self::default();
11972 __struct.time_boot_ms = buf.get_u32_le();
11973 __struct.error_status = buf.get_u32_le();
11974 __struct.battery_status = buf.get_u32_le();
11975 __struct.arm_status = buf.get_u8();
11976 __struct.charge_status = buf.get_u8();
11977 Ok(__struct)
11978 }
11979 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11980 let mut __tmp = BytesMut::new(bytes);
11981 #[allow(clippy::absurd_extreme_comparisons)]
11982 #[allow(unused_comparisons)]
11983 if __tmp.remaining() < Self::ENCODED_LEN {
11984 panic!(
11985 "buffer is too small (need {} bytes, but got {})",
11986 Self::ENCODED_LEN,
11987 __tmp.remaining(),
11988 )
11989 }
11990 __tmp.put_u32_le(self.time_boot_ms);
11991 __tmp.put_u32_le(self.error_status);
11992 __tmp.put_u32_le(self.battery_status);
11993 __tmp.put_u8(self.arm_status);
11994 __tmp.put_u8(self.charge_status);
11995 if matches!(version, MavlinkVersion::V2) {
11996 let len = __tmp.len();
11997 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11998 } else {
11999 __tmp.len()
12000 }
12001 }
12002}
12003#[doc = "id: 85"]
12004#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
12005#[derive(Debug, Clone, PartialEq)]
12006#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12007#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12008pub struct POSITION_TARGET_LOCAL_NED_DATA {
12009 #[doc = "Timestamp (time since system boot)."]
12010 pub time_boot_ms: u32,
12011 #[doc = "X Position in NED frame"]
12012 pub x: f32,
12013 #[doc = "Y Position in NED frame"]
12014 pub y: f32,
12015 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
12016 pub z: f32,
12017 #[doc = "X velocity in NED frame"]
12018 pub vx: f32,
12019 #[doc = "Y velocity in NED frame"]
12020 pub vy: f32,
12021 #[doc = "Z velocity in NED frame"]
12022 pub vz: f32,
12023 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
12024 pub afx: f32,
12025 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
12026 pub afy: f32,
12027 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
12028 pub afz: f32,
12029 #[doc = "yaw setpoint"]
12030 pub yaw: f32,
12031 #[doc = "yaw rate setpoint"]
12032 pub yaw_rate: f32,
12033 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
12034 pub type_mask: PositionTargetTypemask,
12035 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
12036 pub coordinate_frame: MavFrame,
12037}
12038impl POSITION_TARGET_LOCAL_NED_DATA {
12039 pub const ENCODED_LEN: usize = 51usize;
12040 pub const DEFAULT: Self = Self {
12041 time_boot_ms: 0_u32,
12042 x: 0.0_f32,
12043 y: 0.0_f32,
12044 z: 0.0_f32,
12045 vx: 0.0_f32,
12046 vy: 0.0_f32,
12047 vz: 0.0_f32,
12048 afx: 0.0_f32,
12049 afy: 0.0_f32,
12050 afz: 0.0_f32,
12051 yaw: 0.0_f32,
12052 yaw_rate: 0.0_f32,
12053 type_mask: PositionTargetTypemask::DEFAULT,
12054 coordinate_frame: MavFrame::DEFAULT,
12055 };
12056 #[cfg(feature = "arbitrary")]
12057 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12058 use arbitrary::{Arbitrary, Unstructured};
12059 let mut buf = [0u8; 1024];
12060 rng.fill_bytes(&mut buf);
12061 let mut unstructured = Unstructured::new(&buf);
12062 Self::arbitrary(&mut unstructured).unwrap_or_default()
12063 }
12064}
12065impl Default for POSITION_TARGET_LOCAL_NED_DATA {
12066 fn default() -> Self {
12067 Self::DEFAULT.clone()
12068 }
12069}
12070impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
12071 type Message = MavMessage;
12072 const ID: u32 = 85u32;
12073 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
12074 const EXTRA_CRC: u8 = 140u8;
12075 const ENCODED_LEN: usize = 51usize;
12076 fn deser(
12077 _version: MavlinkVersion,
12078 __input: &[u8],
12079 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12080 let avail_len = __input.len();
12081 let mut payload_buf = [0; Self::ENCODED_LEN];
12082 let mut buf = if avail_len < Self::ENCODED_LEN {
12083 payload_buf[0..avail_len].copy_from_slice(__input);
12084 Bytes::new(&payload_buf)
12085 } else {
12086 Bytes::new(__input)
12087 };
12088 let mut __struct = Self::default();
12089 __struct.time_boot_ms = buf.get_u32_le();
12090 __struct.x = buf.get_f32_le();
12091 __struct.y = buf.get_f32_le();
12092 __struct.z = buf.get_f32_le();
12093 __struct.vx = buf.get_f32_le();
12094 __struct.vy = buf.get_f32_le();
12095 __struct.vz = buf.get_f32_le();
12096 __struct.afx = buf.get_f32_le();
12097 __struct.afy = buf.get_f32_le();
12098 __struct.afz = buf.get_f32_le();
12099 __struct.yaw = buf.get_f32_le();
12100 __struct.yaw_rate = buf.get_f32_le();
12101 let tmp = buf.get_u16_le();
12102 __struct.type_mask = PositionTargetTypemask::from_bits(
12103 tmp & PositionTargetTypemask::all().bits(),
12104 )
12105 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12106 flag_type: "PositionTargetTypemask",
12107 value: tmp as u32,
12108 })?;
12109 let tmp = buf.get_u8();
12110 __struct.coordinate_frame =
12111 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12112 enum_type: "MavFrame",
12113 value: tmp as u32,
12114 })?;
12115 Ok(__struct)
12116 }
12117 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12118 let mut __tmp = BytesMut::new(bytes);
12119 #[allow(clippy::absurd_extreme_comparisons)]
12120 #[allow(unused_comparisons)]
12121 if __tmp.remaining() < Self::ENCODED_LEN {
12122 panic!(
12123 "buffer is too small (need {} bytes, but got {})",
12124 Self::ENCODED_LEN,
12125 __tmp.remaining(),
12126 )
12127 }
12128 __tmp.put_u32_le(self.time_boot_ms);
12129 __tmp.put_f32_le(self.x);
12130 __tmp.put_f32_le(self.y);
12131 __tmp.put_f32_le(self.z);
12132 __tmp.put_f32_le(self.vx);
12133 __tmp.put_f32_le(self.vy);
12134 __tmp.put_f32_le(self.vz);
12135 __tmp.put_f32_le(self.afx);
12136 __tmp.put_f32_le(self.afy);
12137 __tmp.put_f32_le(self.afz);
12138 __tmp.put_f32_le(self.yaw);
12139 __tmp.put_f32_le(self.yaw_rate);
12140 __tmp.put_u16_le(self.type_mask.bits());
12141 __tmp.put_u8(self.coordinate_frame as u8);
12142 if matches!(version, MavlinkVersion::V2) {
12143 let len = __tmp.len();
12144 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12145 } else {
12146 __tmp.len()
12147 }
12148 }
12149}
12150#[doc = "id: 34"]
12151#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
12152#[derive(Debug, Clone, PartialEq)]
12153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12154#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12155pub struct RC_CHANNELS_SCALED_DATA {
12156 #[doc = "Timestamp (time since system boot)."]
12157 pub time_boot_ms: u32,
12158 #[doc = "RC channel 1 value scaled."]
12159 pub chan1_scaled: i16,
12160 #[doc = "RC channel 2 value scaled."]
12161 pub chan2_scaled: i16,
12162 #[doc = "RC channel 3 value scaled."]
12163 pub chan3_scaled: i16,
12164 #[doc = "RC channel 4 value scaled."]
12165 pub chan4_scaled: i16,
12166 #[doc = "RC channel 5 value scaled."]
12167 pub chan5_scaled: i16,
12168 #[doc = "RC channel 6 value scaled."]
12169 pub chan6_scaled: i16,
12170 #[doc = "RC channel 7 value scaled."]
12171 pub chan7_scaled: i16,
12172 #[doc = "RC channel 8 value scaled."]
12173 pub chan8_scaled: i16,
12174 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
12175 pub port: u8,
12176 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
12177 pub rssi: u8,
12178}
12179impl RC_CHANNELS_SCALED_DATA {
12180 pub const ENCODED_LEN: usize = 22usize;
12181 pub const DEFAULT: Self = Self {
12182 time_boot_ms: 0_u32,
12183 chan1_scaled: 0_i16,
12184 chan2_scaled: 0_i16,
12185 chan3_scaled: 0_i16,
12186 chan4_scaled: 0_i16,
12187 chan5_scaled: 0_i16,
12188 chan6_scaled: 0_i16,
12189 chan7_scaled: 0_i16,
12190 chan8_scaled: 0_i16,
12191 port: 0_u8,
12192 rssi: 0_u8,
12193 };
12194 #[cfg(feature = "arbitrary")]
12195 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12196 use arbitrary::{Arbitrary, Unstructured};
12197 let mut buf = [0u8; 1024];
12198 rng.fill_bytes(&mut buf);
12199 let mut unstructured = Unstructured::new(&buf);
12200 Self::arbitrary(&mut unstructured).unwrap_or_default()
12201 }
12202}
12203impl Default for RC_CHANNELS_SCALED_DATA {
12204 fn default() -> Self {
12205 Self::DEFAULT.clone()
12206 }
12207}
12208impl MessageData for RC_CHANNELS_SCALED_DATA {
12209 type Message = MavMessage;
12210 const ID: u32 = 34u32;
12211 const NAME: &'static str = "RC_CHANNELS_SCALED";
12212 const EXTRA_CRC: u8 = 237u8;
12213 const ENCODED_LEN: usize = 22usize;
12214 fn deser(
12215 _version: MavlinkVersion,
12216 __input: &[u8],
12217 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12218 let avail_len = __input.len();
12219 let mut payload_buf = [0; Self::ENCODED_LEN];
12220 let mut buf = if avail_len < Self::ENCODED_LEN {
12221 payload_buf[0..avail_len].copy_from_slice(__input);
12222 Bytes::new(&payload_buf)
12223 } else {
12224 Bytes::new(__input)
12225 };
12226 let mut __struct = Self::default();
12227 __struct.time_boot_ms = buf.get_u32_le();
12228 __struct.chan1_scaled = buf.get_i16_le();
12229 __struct.chan2_scaled = buf.get_i16_le();
12230 __struct.chan3_scaled = buf.get_i16_le();
12231 __struct.chan4_scaled = buf.get_i16_le();
12232 __struct.chan5_scaled = buf.get_i16_le();
12233 __struct.chan6_scaled = buf.get_i16_le();
12234 __struct.chan7_scaled = buf.get_i16_le();
12235 __struct.chan8_scaled = buf.get_i16_le();
12236 __struct.port = buf.get_u8();
12237 __struct.rssi = buf.get_u8();
12238 Ok(__struct)
12239 }
12240 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12241 let mut __tmp = BytesMut::new(bytes);
12242 #[allow(clippy::absurd_extreme_comparisons)]
12243 #[allow(unused_comparisons)]
12244 if __tmp.remaining() < Self::ENCODED_LEN {
12245 panic!(
12246 "buffer is too small (need {} bytes, but got {})",
12247 Self::ENCODED_LEN,
12248 __tmp.remaining(),
12249 )
12250 }
12251 __tmp.put_u32_le(self.time_boot_ms);
12252 __tmp.put_i16_le(self.chan1_scaled);
12253 __tmp.put_i16_le(self.chan2_scaled);
12254 __tmp.put_i16_le(self.chan3_scaled);
12255 __tmp.put_i16_le(self.chan4_scaled);
12256 __tmp.put_i16_le(self.chan5_scaled);
12257 __tmp.put_i16_le(self.chan6_scaled);
12258 __tmp.put_i16_le(self.chan7_scaled);
12259 __tmp.put_i16_le(self.chan8_scaled);
12260 __tmp.put_u8(self.port);
12261 __tmp.put_u8(self.rssi);
12262 if matches!(version, MavlinkVersion::V2) {
12263 let len = __tmp.len();
12264 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12265 } else {
12266 __tmp.len()
12267 }
12268 }
12269}
12270#[doc = "id: 339"]
12271#[doc = "RPM sensor data message."]
12272#[derive(Debug, Clone, PartialEq)]
12273#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12274#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12275pub struct RAW_RPM_DATA {
12276 #[doc = "Indicated rate"]
12277 pub frequency: f32,
12278 #[doc = "Index of this RPM sensor (0-indexed)"]
12279 pub index: u8,
12280}
12281impl RAW_RPM_DATA {
12282 pub const ENCODED_LEN: usize = 5usize;
12283 pub const DEFAULT: Self = Self {
12284 frequency: 0.0_f32,
12285 index: 0_u8,
12286 };
12287 #[cfg(feature = "arbitrary")]
12288 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12289 use arbitrary::{Arbitrary, Unstructured};
12290 let mut buf = [0u8; 1024];
12291 rng.fill_bytes(&mut buf);
12292 let mut unstructured = Unstructured::new(&buf);
12293 Self::arbitrary(&mut unstructured).unwrap_or_default()
12294 }
12295}
12296impl Default for RAW_RPM_DATA {
12297 fn default() -> Self {
12298 Self::DEFAULT.clone()
12299 }
12300}
12301impl MessageData for RAW_RPM_DATA {
12302 type Message = MavMessage;
12303 const ID: u32 = 339u32;
12304 const NAME: &'static str = "RAW_RPM";
12305 const EXTRA_CRC: u8 = 199u8;
12306 const ENCODED_LEN: usize = 5usize;
12307 fn deser(
12308 _version: MavlinkVersion,
12309 __input: &[u8],
12310 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12311 let avail_len = __input.len();
12312 let mut payload_buf = [0; Self::ENCODED_LEN];
12313 let mut buf = if avail_len < Self::ENCODED_LEN {
12314 payload_buf[0..avail_len].copy_from_slice(__input);
12315 Bytes::new(&payload_buf)
12316 } else {
12317 Bytes::new(__input)
12318 };
12319 let mut __struct = Self::default();
12320 __struct.frequency = buf.get_f32_le();
12321 __struct.index = buf.get_u8();
12322 Ok(__struct)
12323 }
12324 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12325 let mut __tmp = BytesMut::new(bytes);
12326 #[allow(clippy::absurd_extreme_comparisons)]
12327 #[allow(unused_comparisons)]
12328 if __tmp.remaining() < Self::ENCODED_LEN {
12329 panic!(
12330 "buffer is too small (need {} bytes, but got {})",
12331 Self::ENCODED_LEN,
12332 __tmp.remaining(),
12333 )
12334 }
12335 __tmp.put_f32_le(self.frequency);
12336 __tmp.put_u8(self.index);
12337 if matches!(version, MavlinkVersion::V2) {
12338 let len = __tmp.len();
12339 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12340 } else {
12341 __tmp.len()
12342 }
12343 }
12344}
12345#[doc = "id: 39"]
12346#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
12347#[derive(Debug, Clone, PartialEq)]
12348#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12349#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12350pub struct MISSION_ITEM_DATA {
12351 #[doc = "PARAM1, see MAV_CMD enum"]
12352 pub param1: f32,
12353 #[doc = "PARAM2, see MAV_CMD enum"]
12354 pub param2: f32,
12355 #[doc = "PARAM3, see MAV_CMD enum"]
12356 pub param3: f32,
12357 #[doc = "PARAM4, see MAV_CMD enum"]
12358 pub param4: f32,
12359 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
12360 pub x: f32,
12361 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
12362 pub y: f32,
12363 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
12364 pub z: f32,
12365 #[doc = "Sequence"]
12366 pub seq: u16,
12367 #[doc = "The scheduled action for the waypoint."]
12368 pub command: MavCmd,
12369 #[doc = "System ID"]
12370 pub target_system: u8,
12371 #[doc = "Component ID"]
12372 pub target_component: u8,
12373 #[doc = "The coordinate system of the waypoint."]
12374 pub frame: MavFrame,
12375 #[doc = "false:0, true:1"]
12376 pub current: u8,
12377 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
12378 pub autocontinue: u8,
12379 #[doc = "Mission type."]
12380 #[cfg_attr(feature = "serde", serde(default))]
12381 pub mission_type: MavMissionType,
12382}
12383impl MISSION_ITEM_DATA {
12384 pub const ENCODED_LEN: usize = 38usize;
12385 pub const DEFAULT: Self = Self {
12386 param1: 0.0_f32,
12387 param2: 0.0_f32,
12388 param3: 0.0_f32,
12389 param4: 0.0_f32,
12390 x: 0.0_f32,
12391 y: 0.0_f32,
12392 z: 0.0_f32,
12393 seq: 0_u16,
12394 command: MavCmd::DEFAULT,
12395 target_system: 0_u8,
12396 target_component: 0_u8,
12397 frame: MavFrame::DEFAULT,
12398 current: 0_u8,
12399 autocontinue: 0_u8,
12400 mission_type: MavMissionType::DEFAULT,
12401 };
12402 #[cfg(feature = "arbitrary")]
12403 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12404 use arbitrary::{Arbitrary, Unstructured};
12405 let mut buf = [0u8; 1024];
12406 rng.fill_bytes(&mut buf);
12407 let mut unstructured = Unstructured::new(&buf);
12408 Self::arbitrary(&mut unstructured).unwrap_or_default()
12409 }
12410}
12411impl Default for MISSION_ITEM_DATA {
12412 fn default() -> Self {
12413 Self::DEFAULT.clone()
12414 }
12415}
12416impl MessageData for MISSION_ITEM_DATA {
12417 type Message = MavMessage;
12418 const ID: u32 = 39u32;
12419 const NAME: &'static str = "MISSION_ITEM";
12420 const EXTRA_CRC: u8 = 254u8;
12421 const ENCODED_LEN: usize = 38usize;
12422 fn deser(
12423 _version: MavlinkVersion,
12424 __input: &[u8],
12425 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12426 let avail_len = __input.len();
12427 let mut payload_buf = [0; Self::ENCODED_LEN];
12428 let mut buf = if avail_len < Self::ENCODED_LEN {
12429 payload_buf[0..avail_len].copy_from_slice(__input);
12430 Bytes::new(&payload_buf)
12431 } else {
12432 Bytes::new(__input)
12433 };
12434 let mut __struct = Self::default();
12435 __struct.param1 = buf.get_f32_le();
12436 __struct.param2 = buf.get_f32_le();
12437 __struct.param3 = buf.get_f32_le();
12438 __struct.param4 = buf.get_f32_le();
12439 __struct.x = buf.get_f32_le();
12440 __struct.y = buf.get_f32_le();
12441 __struct.z = buf.get_f32_le();
12442 __struct.seq = buf.get_u16_le();
12443 let tmp = buf.get_u16_le();
12444 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
12445 ::mavlink_core::error::ParserError::InvalidEnum {
12446 enum_type: "MavCmd",
12447 value: tmp as u32,
12448 },
12449 )?;
12450 __struct.target_system = buf.get_u8();
12451 __struct.target_component = buf.get_u8();
12452 let tmp = buf.get_u8();
12453 __struct.frame =
12454 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12455 enum_type: "MavFrame",
12456 value: tmp as u32,
12457 })?;
12458 __struct.current = buf.get_u8();
12459 __struct.autocontinue = buf.get_u8();
12460 let tmp = buf.get_u8();
12461 __struct.mission_type =
12462 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12463 enum_type: "MavMissionType",
12464 value: tmp as u32,
12465 })?;
12466 Ok(__struct)
12467 }
12468 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12469 let mut __tmp = BytesMut::new(bytes);
12470 #[allow(clippy::absurd_extreme_comparisons)]
12471 #[allow(unused_comparisons)]
12472 if __tmp.remaining() < Self::ENCODED_LEN {
12473 panic!(
12474 "buffer is too small (need {} bytes, but got {})",
12475 Self::ENCODED_LEN,
12476 __tmp.remaining(),
12477 )
12478 }
12479 __tmp.put_f32_le(self.param1);
12480 __tmp.put_f32_le(self.param2);
12481 __tmp.put_f32_le(self.param3);
12482 __tmp.put_f32_le(self.param4);
12483 __tmp.put_f32_le(self.x);
12484 __tmp.put_f32_le(self.y);
12485 __tmp.put_f32_le(self.z);
12486 __tmp.put_u16_le(self.seq);
12487 __tmp.put_u16_le(self.command as u16);
12488 __tmp.put_u8(self.target_system);
12489 __tmp.put_u8(self.target_component);
12490 __tmp.put_u8(self.frame as u8);
12491 __tmp.put_u8(self.current);
12492 __tmp.put_u8(self.autocontinue);
12493 __tmp.put_u8(self.mission_type as u8);
12494 if matches!(version, MavlinkVersion::V2) {
12495 let len = __tmp.len();
12496 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12497 } else {
12498 __tmp.len()
12499 }
12500 }
12501}
12502#[doc = "id: 51"]
12503#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
12504#[derive(Debug, Clone, PartialEq)]
12505#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12506#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12507pub struct MISSION_REQUEST_INT_DATA {
12508 #[doc = "Sequence"]
12509 pub seq: u16,
12510 #[doc = "System ID"]
12511 pub target_system: u8,
12512 #[doc = "Component ID"]
12513 pub target_component: u8,
12514 #[doc = "Mission type."]
12515 #[cfg_attr(feature = "serde", serde(default))]
12516 pub mission_type: MavMissionType,
12517}
12518impl MISSION_REQUEST_INT_DATA {
12519 pub const ENCODED_LEN: usize = 5usize;
12520 pub const DEFAULT: Self = Self {
12521 seq: 0_u16,
12522 target_system: 0_u8,
12523 target_component: 0_u8,
12524 mission_type: MavMissionType::DEFAULT,
12525 };
12526 #[cfg(feature = "arbitrary")]
12527 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12528 use arbitrary::{Arbitrary, Unstructured};
12529 let mut buf = [0u8; 1024];
12530 rng.fill_bytes(&mut buf);
12531 let mut unstructured = Unstructured::new(&buf);
12532 Self::arbitrary(&mut unstructured).unwrap_or_default()
12533 }
12534}
12535impl Default for MISSION_REQUEST_INT_DATA {
12536 fn default() -> Self {
12537 Self::DEFAULT.clone()
12538 }
12539}
12540impl MessageData for MISSION_REQUEST_INT_DATA {
12541 type Message = MavMessage;
12542 const ID: u32 = 51u32;
12543 const NAME: &'static str = "MISSION_REQUEST_INT";
12544 const EXTRA_CRC: u8 = 196u8;
12545 const ENCODED_LEN: usize = 5usize;
12546 fn deser(
12547 _version: MavlinkVersion,
12548 __input: &[u8],
12549 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12550 let avail_len = __input.len();
12551 let mut payload_buf = [0; Self::ENCODED_LEN];
12552 let mut buf = if avail_len < Self::ENCODED_LEN {
12553 payload_buf[0..avail_len].copy_from_slice(__input);
12554 Bytes::new(&payload_buf)
12555 } else {
12556 Bytes::new(__input)
12557 };
12558 let mut __struct = Self::default();
12559 __struct.seq = buf.get_u16_le();
12560 __struct.target_system = buf.get_u8();
12561 __struct.target_component = buf.get_u8();
12562 let tmp = buf.get_u8();
12563 __struct.mission_type =
12564 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12565 enum_type: "MavMissionType",
12566 value: tmp as u32,
12567 })?;
12568 Ok(__struct)
12569 }
12570 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12571 let mut __tmp = BytesMut::new(bytes);
12572 #[allow(clippy::absurd_extreme_comparisons)]
12573 #[allow(unused_comparisons)]
12574 if __tmp.remaining() < Self::ENCODED_LEN {
12575 panic!(
12576 "buffer is too small (need {} bytes, but got {})",
12577 Self::ENCODED_LEN,
12578 __tmp.remaining(),
12579 )
12580 }
12581 __tmp.put_u16_le(self.seq);
12582 __tmp.put_u8(self.target_system);
12583 __tmp.put_u8(self.target_component);
12584 __tmp.put_u8(self.mission_type as u8);
12585 if matches!(version, MavlinkVersion::V2) {
12586 let len = __tmp.len();
12587 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12588 } else {
12589 __tmp.len()
12590 }
12591 }
12592}
12593#[doc = "id: 133"]
12594#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
12595#[derive(Debug, Clone, PartialEq)]
12596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12597#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12598pub struct TERRAIN_REQUEST_DATA {
12599 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
12600 pub mask: u64,
12601 #[doc = "Latitude of SW corner of first grid"]
12602 pub lat: i32,
12603 #[doc = "Longitude of SW corner of first grid"]
12604 pub lon: i32,
12605 #[doc = "Grid spacing"]
12606 pub grid_spacing: u16,
12607}
12608impl TERRAIN_REQUEST_DATA {
12609 pub const ENCODED_LEN: usize = 18usize;
12610 pub const DEFAULT: Self = Self {
12611 mask: 0_u64,
12612 lat: 0_i32,
12613 lon: 0_i32,
12614 grid_spacing: 0_u16,
12615 };
12616 #[cfg(feature = "arbitrary")]
12617 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12618 use arbitrary::{Arbitrary, Unstructured};
12619 let mut buf = [0u8; 1024];
12620 rng.fill_bytes(&mut buf);
12621 let mut unstructured = Unstructured::new(&buf);
12622 Self::arbitrary(&mut unstructured).unwrap_or_default()
12623 }
12624}
12625impl Default for TERRAIN_REQUEST_DATA {
12626 fn default() -> Self {
12627 Self::DEFAULT.clone()
12628 }
12629}
12630impl MessageData for TERRAIN_REQUEST_DATA {
12631 type Message = MavMessage;
12632 const ID: u32 = 133u32;
12633 const NAME: &'static str = "TERRAIN_REQUEST";
12634 const EXTRA_CRC: u8 = 6u8;
12635 const ENCODED_LEN: usize = 18usize;
12636 fn deser(
12637 _version: MavlinkVersion,
12638 __input: &[u8],
12639 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12640 let avail_len = __input.len();
12641 let mut payload_buf = [0; Self::ENCODED_LEN];
12642 let mut buf = if avail_len < Self::ENCODED_LEN {
12643 payload_buf[0..avail_len].copy_from_slice(__input);
12644 Bytes::new(&payload_buf)
12645 } else {
12646 Bytes::new(__input)
12647 };
12648 let mut __struct = Self::default();
12649 __struct.mask = buf.get_u64_le();
12650 __struct.lat = buf.get_i32_le();
12651 __struct.lon = buf.get_i32_le();
12652 __struct.grid_spacing = buf.get_u16_le();
12653 Ok(__struct)
12654 }
12655 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12656 let mut __tmp = BytesMut::new(bytes);
12657 #[allow(clippy::absurd_extreme_comparisons)]
12658 #[allow(unused_comparisons)]
12659 if __tmp.remaining() < Self::ENCODED_LEN {
12660 panic!(
12661 "buffer is too small (need {} bytes, but got {})",
12662 Self::ENCODED_LEN,
12663 __tmp.remaining(),
12664 )
12665 }
12666 __tmp.put_u64_le(self.mask);
12667 __tmp.put_i32_le(self.lat);
12668 __tmp.put_i32_le(self.lon);
12669 __tmp.put_u16_le(self.grid_spacing);
12670 if matches!(version, MavlinkVersion::V2) {
12671 let len = __tmp.len();
12672 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12673 } else {
12674 __tmp.len()
12675 }
12676 }
12677}
12678#[doc = "id: 9000"]
12679#[doc = "Cumulative distance traveled for each reported wheel."]
12680#[derive(Debug, Clone, PartialEq)]
12681#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12682#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12683pub struct WHEEL_DISTANCE_DATA {
12684 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
12685 pub time_usec: u64,
12686 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
12687 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12688 pub distance: [f64; 16],
12689 #[doc = "Number of wheels reported."]
12690 pub count: u8,
12691}
12692impl WHEEL_DISTANCE_DATA {
12693 pub const ENCODED_LEN: usize = 137usize;
12694 pub const DEFAULT: Self = Self {
12695 time_usec: 0_u64,
12696 distance: [0.0_f64; 16usize],
12697 count: 0_u8,
12698 };
12699 #[cfg(feature = "arbitrary")]
12700 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12701 use arbitrary::{Arbitrary, Unstructured};
12702 let mut buf = [0u8; 1024];
12703 rng.fill_bytes(&mut buf);
12704 let mut unstructured = Unstructured::new(&buf);
12705 Self::arbitrary(&mut unstructured).unwrap_or_default()
12706 }
12707}
12708impl Default for WHEEL_DISTANCE_DATA {
12709 fn default() -> Self {
12710 Self::DEFAULT.clone()
12711 }
12712}
12713impl MessageData for WHEEL_DISTANCE_DATA {
12714 type Message = MavMessage;
12715 const ID: u32 = 9000u32;
12716 const NAME: &'static str = "WHEEL_DISTANCE";
12717 const EXTRA_CRC: u8 = 113u8;
12718 const ENCODED_LEN: usize = 137usize;
12719 fn deser(
12720 _version: MavlinkVersion,
12721 __input: &[u8],
12722 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12723 let avail_len = __input.len();
12724 let mut payload_buf = [0; Self::ENCODED_LEN];
12725 let mut buf = if avail_len < Self::ENCODED_LEN {
12726 payload_buf[0..avail_len].copy_from_slice(__input);
12727 Bytes::new(&payload_buf)
12728 } else {
12729 Bytes::new(__input)
12730 };
12731 let mut __struct = Self::default();
12732 __struct.time_usec = buf.get_u64_le();
12733 for v in &mut __struct.distance {
12734 let val = buf.get_f64_le();
12735 *v = val;
12736 }
12737 __struct.count = buf.get_u8();
12738 Ok(__struct)
12739 }
12740 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12741 let mut __tmp = BytesMut::new(bytes);
12742 #[allow(clippy::absurd_extreme_comparisons)]
12743 #[allow(unused_comparisons)]
12744 if __tmp.remaining() < Self::ENCODED_LEN {
12745 panic!(
12746 "buffer is too small (need {} bytes, but got {})",
12747 Self::ENCODED_LEN,
12748 __tmp.remaining(),
12749 )
12750 }
12751 __tmp.put_u64_le(self.time_usec);
12752 for val in &self.distance {
12753 __tmp.put_f64_le(*val);
12754 }
12755 __tmp.put_u8(self.count);
12756 if matches!(version, MavlinkVersion::V2) {
12757 let len = __tmp.len();
12758 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12759 } else {
12760 __tmp.len()
12761 }
12762 }
12763}
12764#[doc = "id: 411"]
12765#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
12766#[derive(Debug, Clone, PartialEq)]
12767#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12768#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12769pub struct CURRENT_EVENT_SEQUENCE_DATA {
12770 #[doc = "Sequence number."]
12771 pub sequence: u16,
12772 #[doc = "Flag bitset."]
12773 pub flags: MavEventCurrentSequenceFlags,
12774}
12775impl CURRENT_EVENT_SEQUENCE_DATA {
12776 pub const ENCODED_LEN: usize = 3usize;
12777 pub const DEFAULT: Self = Self {
12778 sequence: 0_u16,
12779 flags: MavEventCurrentSequenceFlags::DEFAULT,
12780 };
12781 #[cfg(feature = "arbitrary")]
12782 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12783 use arbitrary::{Arbitrary, Unstructured};
12784 let mut buf = [0u8; 1024];
12785 rng.fill_bytes(&mut buf);
12786 let mut unstructured = Unstructured::new(&buf);
12787 Self::arbitrary(&mut unstructured).unwrap_or_default()
12788 }
12789}
12790impl Default for CURRENT_EVENT_SEQUENCE_DATA {
12791 fn default() -> Self {
12792 Self::DEFAULT.clone()
12793 }
12794}
12795impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
12796 type Message = MavMessage;
12797 const ID: u32 = 411u32;
12798 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
12799 const EXTRA_CRC: u8 = 106u8;
12800 const ENCODED_LEN: usize = 3usize;
12801 fn deser(
12802 _version: MavlinkVersion,
12803 __input: &[u8],
12804 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12805 let avail_len = __input.len();
12806 let mut payload_buf = [0; Self::ENCODED_LEN];
12807 let mut buf = if avail_len < Self::ENCODED_LEN {
12808 payload_buf[0..avail_len].copy_from_slice(__input);
12809 Bytes::new(&payload_buf)
12810 } else {
12811 Bytes::new(__input)
12812 };
12813 let mut __struct = Self::default();
12814 __struct.sequence = buf.get_u16_le();
12815 let tmp = buf.get_u8();
12816 __struct.flags =
12817 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
12818 enum_type: "MavEventCurrentSequenceFlags",
12819 value: tmp as u32,
12820 })?;
12821 Ok(__struct)
12822 }
12823 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12824 let mut __tmp = BytesMut::new(bytes);
12825 #[allow(clippy::absurd_extreme_comparisons)]
12826 #[allow(unused_comparisons)]
12827 if __tmp.remaining() < Self::ENCODED_LEN {
12828 panic!(
12829 "buffer is too small (need {} bytes, but got {})",
12830 Self::ENCODED_LEN,
12831 __tmp.remaining(),
12832 )
12833 }
12834 __tmp.put_u16_le(self.sequence);
12835 __tmp.put_u8(self.flags as u8);
12836 if matches!(version, MavlinkVersion::V2) {
12837 let len = __tmp.len();
12838 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12839 } else {
12840 __tmp.len()
12841 }
12842 }
12843}
12844#[doc = "id: 287"]
12845#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
12846#[derive(Debug, Clone, PartialEq)]
12847#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12848#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12849pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12850 #[doc = "High level gimbal manager flags to use."]
12851 pub flags: GimbalManagerFlags,
12852 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
12853 pub pitch: f32,
12854 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
12855 pub yaw: f32,
12856 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
12857 pub pitch_rate: f32,
12858 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
12859 pub yaw_rate: f32,
12860 #[doc = "System ID"]
12861 pub target_system: u8,
12862 #[doc = "Component ID"]
12863 pub target_component: u8,
12864 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12865 pub gimbal_device_id: u8,
12866}
12867impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12868 pub const ENCODED_LEN: usize = 23usize;
12869 pub const DEFAULT: Self = Self {
12870 flags: GimbalManagerFlags::DEFAULT,
12871 pitch: 0.0_f32,
12872 yaw: 0.0_f32,
12873 pitch_rate: 0.0_f32,
12874 yaw_rate: 0.0_f32,
12875 target_system: 0_u8,
12876 target_component: 0_u8,
12877 gimbal_device_id: 0_u8,
12878 };
12879 #[cfg(feature = "arbitrary")]
12880 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12881 use arbitrary::{Arbitrary, Unstructured};
12882 let mut buf = [0u8; 1024];
12883 rng.fill_bytes(&mut buf);
12884 let mut unstructured = Unstructured::new(&buf);
12885 Self::arbitrary(&mut unstructured).unwrap_or_default()
12886 }
12887}
12888impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12889 fn default() -> Self {
12890 Self::DEFAULT.clone()
12891 }
12892}
12893impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
12894 type Message = MavMessage;
12895 const ID: u32 = 287u32;
12896 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
12897 const EXTRA_CRC: u8 = 1u8;
12898 const ENCODED_LEN: usize = 23usize;
12899 fn deser(
12900 _version: MavlinkVersion,
12901 __input: &[u8],
12902 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12903 let avail_len = __input.len();
12904 let mut payload_buf = [0; Self::ENCODED_LEN];
12905 let mut buf = if avail_len < Self::ENCODED_LEN {
12906 payload_buf[0..avail_len].copy_from_slice(__input);
12907 Bytes::new(&payload_buf)
12908 } else {
12909 Bytes::new(__input)
12910 };
12911 let mut __struct = Self::default();
12912 let tmp = buf.get_u32_le();
12913 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12914 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12915 flag_type: "GimbalManagerFlags",
12916 value: tmp as u32,
12917 })?;
12918 __struct.pitch = buf.get_f32_le();
12919 __struct.yaw = buf.get_f32_le();
12920 __struct.pitch_rate = buf.get_f32_le();
12921 __struct.yaw_rate = buf.get_f32_le();
12922 __struct.target_system = buf.get_u8();
12923 __struct.target_component = buf.get_u8();
12924 __struct.gimbal_device_id = buf.get_u8();
12925 Ok(__struct)
12926 }
12927 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12928 let mut __tmp = BytesMut::new(bytes);
12929 #[allow(clippy::absurd_extreme_comparisons)]
12930 #[allow(unused_comparisons)]
12931 if __tmp.remaining() < Self::ENCODED_LEN {
12932 panic!(
12933 "buffer is too small (need {} bytes, but got {})",
12934 Self::ENCODED_LEN,
12935 __tmp.remaining(),
12936 )
12937 }
12938 __tmp.put_u32_le(self.flags.bits());
12939 __tmp.put_f32_le(self.pitch);
12940 __tmp.put_f32_le(self.yaw);
12941 __tmp.put_f32_le(self.pitch_rate);
12942 __tmp.put_f32_le(self.yaw_rate);
12943 __tmp.put_u8(self.target_system);
12944 __tmp.put_u8(self.target_component);
12945 __tmp.put_u8(self.gimbal_device_id);
12946 if matches!(version, MavlinkVersion::V2) {
12947 let len = __tmp.len();
12948 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12949 } else {
12950 __tmp.len()
12951 }
12952 }
12953}
12954#[doc = "id: 324"]
12955#[doc = "Response from a PARAM_EXT_SET message."]
12956#[derive(Debug, Clone, PartialEq)]
12957#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12958#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12959pub struct PARAM_EXT_ACK_DATA {
12960 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
12961 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12962 pub param_id: [u8; 16],
12963 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
12964 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12965 pub param_value: [u8; 128],
12966 #[doc = "Parameter type."]
12967 pub param_type: MavParamExtType,
12968 #[doc = "Result code."]
12969 pub param_result: ParamAck,
12970}
12971impl PARAM_EXT_ACK_DATA {
12972 pub const ENCODED_LEN: usize = 146usize;
12973 pub const DEFAULT: Self = Self {
12974 param_id: [0_u8; 16usize],
12975 param_value: [0_u8; 128usize],
12976 param_type: MavParamExtType::DEFAULT,
12977 param_result: ParamAck::DEFAULT,
12978 };
12979 #[cfg(feature = "arbitrary")]
12980 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12981 use arbitrary::{Arbitrary, Unstructured};
12982 let mut buf = [0u8; 1024];
12983 rng.fill_bytes(&mut buf);
12984 let mut unstructured = Unstructured::new(&buf);
12985 Self::arbitrary(&mut unstructured).unwrap_or_default()
12986 }
12987}
12988impl Default for PARAM_EXT_ACK_DATA {
12989 fn default() -> Self {
12990 Self::DEFAULT.clone()
12991 }
12992}
12993impl MessageData for PARAM_EXT_ACK_DATA {
12994 type Message = MavMessage;
12995 const ID: u32 = 324u32;
12996 const NAME: &'static str = "PARAM_EXT_ACK";
12997 const EXTRA_CRC: u8 = 132u8;
12998 const ENCODED_LEN: usize = 146usize;
12999 fn deser(
13000 _version: MavlinkVersion,
13001 __input: &[u8],
13002 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13003 let avail_len = __input.len();
13004 let mut payload_buf = [0; Self::ENCODED_LEN];
13005 let mut buf = if avail_len < Self::ENCODED_LEN {
13006 payload_buf[0..avail_len].copy_from_slice(__input);
13007 Bytes::new(&payload_buf)
13008 } else {
13009 Bytes::new(__input)
13010 };
13011 let mut __struct = Self::default();
13012 for v in &mut __struct.param_id {
13013 let val = buf.get_u8();
13014 *v = val;
13015 }
13016 for v in &mut __struct.param_value {
13017 let val = buf.get_u8();
13018 *v = val;
13019 }
13020 let tmp = buf.get_u8();
13021 __struct.param_type =
13022 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13023 enum_type: "MavParamExtType",
13024 value: tmp as u32,
13025 })?;
13026 let tmp = buf.get_u8();
13027 __struct.param_result =
13028 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13029 enum_type: "ParamAck",
13030 value: tmp as u32,
13031 })?;
13032 Ok(__struct)
13033 }
13034 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13035 let mut __tmp = BytesMut::new(bytes);
13036 #[allow(clippy::absurd_extreme_comparisons)]
13037 #[allow(unused_comparisons)]
13038 if __tmp.remaining() < Self::ENCODED_LEN {
13039 panic!(
13040 "buffer is too small (need {} bytes, but got {})",
13041 Self::ENCODED_LEN,
13042 __tmp.remaining(),
13043 )
13044 }
13045 for val in &self.param_id {
13046 __tmp.put_u8(*val);
13047 }
13048 for val in &self.param_value {
13049 __tmp.put_u8(*val);
13050 }
13051 __tmp.put_u8(self.param_type as u8);
13052 __tmp.put_u8(self.param_result as u8);
13053 if matches!(version, MavlinkVersion::V2) {
13054 let len = __tmp.len();
13055 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13056 } else {
13057 __tmp.len()
13058 }
13059 }
13060}
13061#[doc = "id: 331"]
13062#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
13063#[derive(Debug, Clone, PartialEq)]
13064#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13065#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13066pub struct ODOMETRY_DATA {
13067 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13068 pub time_usec: u64,
13069 #[doc = "X Position"]
13070 pub x: f32,
13071 #[doc = "Y Position"]
13072 pub y: f32,
13073 #[doc = "Z Position"]
13074 pub z: f32,
13075 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
13076 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13077 pub q: [f32; 4],
13078 #[doc = "X linear speed"]
13079 pub vx: f32,
13080 #[doc = "Y linear speed"]
13081 pub vy: f32,
13082 #[doc = "Z linear speed"]
13083 pub vz: f32,
13084 #[doc = "Roll angular speed"]
13085 pub rollspeed: f32,
13086 #[doc = "Pitch angular speed"]
13087 pub pitchspeed: f32,
13088 #[doc = "Yaw angular speed"]
13089 pub yawspeed: f32,
13090 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13091 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13092 pub pose_covariance: [f32; 21],
13093 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13094 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13095 pub velocity_covariance: [f32; 21],
13096 #[doc = "Coordinate frame of reference for the pose data."]
13097 pub frame_id: MavFrame,
13098 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
13099 pub child_frame_id: MavFrame,
13100 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13101 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13102 pub reset_counter: u8,
13103 #[doc = "Type of estimator that is providing the odometry."]
13104 #[cfg_attr(feature = "serde", serde(default))]
13105 pub estimator_type: MavEstimatorType,
13106 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
13107 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13108 pub quality: i8,
13109}
13110impl ODOMETRY_DATA {
13111 pub const ENCODED_LEN: usize = 233usize;
13112 pub const DEFAULT: Self = Self {
13113 time_usec: 0_u64,
13114 x: 0.0_f32,
13115 y: 0.0_f32,
13116 z: 0.0_f32,
13117 q: [0.0_f32; 4usize],
13118 vx: 0.0_f32,
13119 vy: 0.0_f32,
13120 vz: 0.0_f32,
13121 rollspeed: 0.0_f32,
13122 pitchspeed: 0.0_f32,
13123 yawspeed: 0.0_f32,
13124 pose_covariance: [0.0_f32; 21usize],
13125 velocity_covariance: [0.0_f32; 21usize],
13126 frame_id: MavFrame::DEFAULT,
13127 child_frame_id: MavFrame::DEFAULT,
13128 reset_counter: 0_u8,
13129 estimator_type: MavEstimatorType::DEFAULT,
13130 quality: 0_i8,
13131 };
13132 #[cfg(feature = "arbitrary")]
13133 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13134 use arbitrary::{Arbitrary, Unstructured};
13135 let mut buf = [0u8; 1024];
13136 rng.fill_bytes(&mut buf);
13137 let mut unstructured = Unstructured::new(&buf);
13138 Self::arbitrary(&mut unstructured).unwrap_or_default()
13139 }
13140}
13141impl Default for ODOMETRY_DATA {
13142 fn default() -> Self {
13143 Self::DEFAULT.clone()
13144 }
13145}
13146impl MessageData for ODOMETRY_DATA {
13147 type Message = MavMessage;
13148 const ID: u32 = 331u32;
13149 const NAME: &'static str = "ODOMETRY";
13150 const EXTRA_CRC: u8 = 91u8;
13151 const ENCODED_LEN: usize = 233usize;
13152 fn deser(
13153 _version: MavlinkVersion,
13154 __input: &[u8],
13155 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13156 let avail_len = __input.len();
13157 let mut payload_buf = [0; Self::ENCODED_LEN];
13158 let mut buf = if avail_len < Self::ENCODED_LEN {
13159 payload_buf[0..avail_len].copy_from_slice(__input);
13160 Bytes::new(&payload_buf)
13161 } else {
13162 Bytes::new(__input)
13163 };
13164 let mut __struct = Self::default();
13165 __struct.time_usec = buf.get_u64_le();
13166 __struct.x = buf.get_f32_le();
13167 __struct.y = buf.get_f32_le();
13168 __struct.z = buf.get_f32_le();
13169 for v in &mut __struct.q {
13170 let val = buf.get_f32_le();
13171 *v = val;
13172 }
13173 __struct.vx = buf.get_f32_le();
13174 __struct.vy = buf.get_f32_le();
13175 __struct.vz = buf.get_f32_le();
13176 __struct.rollspeed = buf.get_f32_le();
13177 __struct.pitchspeed = buf.get_f32_le();
13178 __struct.yawspeed = buf.get_f32_le();
13179 for v in &mut __struct.pose_covariance {
13180 let val = buf.get_f32_le();
13181 *v = val;
13182 }
13183 for v in &mut __struct.velocity_covariance {
13184 let val = buf.get_f32_le();
13185 *v = val;
13186 }
13187 let tmp = buf.get_u8();
13188 __struct.frame_id =
13189 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13190 enum_type: "MavFrame",
13191 value: tmp as u32,
13192 })?;
13193 let tmp = buf.get_u8();
13194 __struct.child_frame_id =
13195 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13196 enum_type: "MavFrame",
13197 value: tmp as u32,
13198 })?;
13199 __struct.reset_counter = buf.get_u8();
13200 let tmp = buf.get_u8();
13201 __struct.estimator_type =
13202 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13203 enum_type: "MavEstimatorType",
13204 value: tmp as u32,
13205 })?;
13206 __struct.quality = buf.get_i8();
13207 Ok(__struct)
13208 }
13209 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13210 let mut __tmp = BytesMut::new(bytes);
13211 #[allow(clippy::absurd_extreme_comparisons)]
13212 #[allow(unused_comparisons)]
13213 if __tmp.remaining() < Self::ENCODED_LEN {
13214 panic!(
13215 "buffer is too small (need {} bytes, but got {})",
13216 Self::ENCODED_LEN,
13217 __tmp.remaining(),
13218 )
13219 }
13220 __tmp.put_u64_le(self.time_usec);
13221 __tmp.put_f32_le(self.x);
13222 __tmp.put_f32_le(self.y);
13223 __tmp.put_f32_le(self.z);
13224 for val in &self.q {
13225 __tmp.put_f32_le(*val);
13226 }
13227 __tmp.put_f32_le(self.vx);
13228 __tmp.put_f32_le(self.vy);
13229 __tmp.put_f32_le(self.vz);
13230 __tmp.put_f32_le(self.rollspeed);
13231 __tmp.put_f32_le(self.pitchspeed);
13232 __tmp.put_f32_le(self.yawspeed);
13233 for val in &self.pose_covariance {
13234 __tmp.put_f32_le(*val);
13235 }
13236 for val in &self.velocity_covariance {
13237 __tmp.put_f32_le(*val);
13238 }
13239 __tmp.put_u8(self.frame_id as u8);
13240 __tmp.put_u8(self.child_frame_id as u8);
13241 __tmp.put_u8(self.reset_counter);
13242 __tmp.put_u8(self.estimator_type as u8);
13243 __tmp.put_i8(self.quality);
13244 if matches!(version, MavlinkVersion::V2) {
13245 let len = __tmp.len();
13246 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13247 } else {
13248 __tmp.len()
13249 }
13250 }
13251}
13252#[doc = "id: 36"]
13253#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
13254#[derive(Debug, Clone, PartialEq)]
13255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13256#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13257pub struct SERVO_OUTPUT_RAW_DATA {
13258 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13259 pub time_usec: u32,
13260 #[doc = "Servo output 1 value"]
13261 pub servo1_raw: u16,
13262 #[doc = "Servo output 2 value"]
13263 pub servo2_raw: u16,
13264 #[doc = "Servo output 3 value"]
13265 pub servo3_raw: u16,
13266 #[doc = "Servo output 4 value"]
13267 pub servo4_raw: u16,
13268 #[doc = "Servo output 5 value"]
13269 pub servo5_raw: u16,
13270 #[doc = "Servo output 6 value"]
13271 pub servo6_raw: u16,
13272 #[doc = "Servo output 7 value"]
13273 pub servo7_raw: u16,
13274 #[doc = "Servo output 8 value"]
13275 pub servo8_raw: u16,
13276 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
13277 pub port: u8,
13278 #[doc = "Servo output 9 value"]
13279 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13280 pub servo9_raw: u16,
13281 #[doc = "Servo output 10 value"]
13282 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13283 pub servo10_raw: u16,
13284 #[doc = "Servo output 11 value"]
13285 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13286 pub servo11_raw: u16,
13287 #[doc = "Servo output 12 value"]
13288 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13289 pub servo12_raw: u16,
13290 #[doc = "Servo output 13 value"]
13291 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13292 pub servo13_raw: u16,
13293 #[doc = "Servo output 14 value"]
13294 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13295 pub servo14_raw: u16,
13296 #[doc = "Servo output 15 value"]
13297 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13298 pub servo15_raw: u16,
13299 #[doc = "Servo output 16 value"]
13300 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13301 pub servo16_raw: u16,
13302}
13303impl SERVO_OUTPUT_RAW_DATA {
13304 pub const ENCODED_LEN: usize = 37usize;
13305 pub const DEFAULT: Self = Self {
13306 time_usec: 0_u32,
13307 servo1_raw: 0_u16,
13308 servo2_raw: 0_u16,
13309 servo3_raw: 0_u16,
13310 servo4_raw: 0_u16,
13311 servo5_raw: 0_u16,
13312 servo6_raw: 0_u16,
13313 servo7_raw: 0_u16,
13314 servo8_raw: 0_u16,
13315 port: 0_u8,
13316 servo9_raw: 0_u16,
13317 servo10_raw: 0_u16,
13318 servo11_raw: 0_u16,
13319 servo12_raw: 0_u16,
13320 servo13_raw: 0_u16,
13321 servo14_raw: 0_u16,
13322 servo15_raw: 0_u16,
13323 servo16_raw: 0_u16,
13324 };
13325 #[cfg(feature = "arbitrary")]
13326 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13327 use arbitrary::{Arbitrary, Unstructured};
13328 let mut buf = [0u8; 1024];
13329 rng.fill_bytes(&mut buf);
13330 let mut unstructured = Unstructured::new(&buf);
13331 Self::arbitrary(&mut unstructured).unwrap_or_default()
13332 }
13333}
13334impl Default for SERVO_OUTPUT_RAW_DATA {
13335 fn default() -> Self {
13336 Self::DEFAULT.clone()
13337 }
13338}
13339impl MessageData for SERVO_OUTPUT_RAW_DATA {
13340 type Message = MavMessage;
13341 const ID: u32 = 36u32;
13342 const NAME: &'static str = "SERVO_OUTPUT_RAW";
13343 const EXTRA_CRC: u8 = 222u8;
13344 const ENCODED_LEN: usize = 37usize;
13345 fn deser(
13346 _version: MavlinkVersion,
13347 __input: &[u8],
13348 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13349 let avail_len = __input.len();
13350 let mut payload_buf = [0; Self::ENCODED_LEN];
13351 let mut buf = if avail_len < Self::ENCODED_LEN {
13352 payload_buf[0..avail_len].copy_from_slice(__input);
13353 Bytes::new(&payload_buf)
13354 } else {
13355 Bytes::new(__input)
13356 };
13357 let mut __struct = Self::default();
13358 __struct.time_usec = buf.get_u32_le();
13359 __struct.servo1_raw = buf.get_u16_le();
13360 __struct.servo2_raw = buf.get_u16_le();
13361 __struct.servo3_raw = buf.get_u16_le();
13362 __struct.servo4_raw = buf.get_u16_le();
13363 __struct.servo5_raw = buf.get_u16_le();
13364 __struct.servo6_raw = buf.get_u16_le();
13365 __struct.servo7_raw = buf.get_u16_le();
13366 __struct.servo8_raw = buf.get_u16_le();
13367 __struct.port = buf.get_u8();
13368 __struct.servo9_raw = buf.get_u16_le();
13369 __struct.servo10_raw = buf.get_u16_le();
13370 __struct.servo11_raw = buf.get_u16_le();
13371 __struct.servo12_raw = buf.get_u16_le();
13372 __struct.servo13_raw = buf.get_u16_le();
13373 __struct.servo14_raw = buf.get_u16_le();
13374 __struct.servo15_raw = buf.get_u16_le();
13375 __struct.servo16_raw = buf.get_u16_le();
13376 Ok(__struct)
13377 }
13378 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13379 let mut __tmp = BytesMut::new(bytes);
13380 #[allow(clippy::absurd_extreme_comparisons)]
13381 #[allow(unused_comparisons)]
13382 if __tmp.remaining() < Self::ENCODED_LEN {
13383 panic!(
13384 "buffer is too small (need {} bytes, but got {})",
13385 Self::ENCODED_LEN,
13386 __tmp.remaining(),
13387 )
13388 }
13389 __tmp.put_u32_le(self.time_usec);
13390 __tmp.put_u16_le(self.servo1_raw);
13391 __tmp.put_u16_le(self.servo2_raw);
13392 __tmp.put_u16_le(self.servo3_raw);
13393 __tmp.put_u16_le(self.servo4_raw);
13394 __tmp.put_u16_le(self.servo5_raw);
13395 __tmp.put_u16_le(self.servo6_raw);
13396 __tmp.put_u16_le(self.servo7_raw);
13397 __tmp.put_u16_le(self.servo8_raw);
13398 __tmp.put_u8(self.port);
13399 __tmp.put_u16_le(self.servo9_raw);
13400 __tmp.put_u16_le(self.servo10_raw);
13401 __tmp.put_u16_le(self.servo11_raw);
13402 __tmp.put_u16_le(self.servo12_raw);
13403 __tmp.put_u16_le(self.servo13_raw);
13404 __tmp.put_u16_le(self.servo14_raw);
13405 __tmp.put_u16_le(self.servo15_raw);
13406 __tmp.put_u16_le(self.servo16_raw);
13407 if matches!(version, MavlinkVersion::V2) {
13408 let len = __tmp.len();
13409 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13410 } else {
13411 __tmp.len()
13412 }
13413 }
13414}
13415#[doc = "id: 66"]
13416#[doc = "Request a data stream."]
13417#[derive(Debug, Clone, PartialEq)]
13418#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13419#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13420pub struct REQUEST_DATA_STREAM_DATA {
13421 #[doc = "The requested message rate"]
13422 pub req_message_rate: u16,
13423 #[doc = "The target requested to send the message stream."]
13424 pub target_system: u8,
13425 #[doc = "The target requested to send the message stream."]
13426 pub target_component: u8,
13427 #[doc = "The ID of the requested data stream"]
13428 pub req_stream_id: u8,
13429 #[doc = "1 to start sending, 0 to stop sending."]
13430 pub start_stop: u8,
13431}
13432impl REQUEST_DATA_STREAM_DATA {
13433 pub const ENCODED_LEN: usize = 6usize;
13434 pub const DEFAULT: Self = Self {
13435 req_message_rate: 0_u16,
13436 target_system: 0_u8,
13437 target_component: 0_u8,
13438 req_stream_id: 0_u8,
13439 start_stop: 0_u8,
13440 };
13441 #[cfg(feature = "arbitrary")]
13442 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13443 use arbitrary::{Arbitrary, Unstructured};
13444 let mut buf = [0u8; 1024];
13445 rng.fill_bytes(&mut buf);
13446 let mut unstructured = Unstructured::new(&buf);
13447 Self::arbitrary(&mut unstructured).unwrap_or_default()
13448 }
13449}
13450impl Default for REQUEST_DATA_STREAM_DATA {
13451 fn default() -> Self {
13452 Self::DEFAULT.clone()
13453 }
13454}
13455impl MessageData for REQUEST_DATA_STREAM_DATA {
13456 type Message = MavMessage;
13457 const ID: u32 = 66u32;
13458 const NAME: &'static str = "REQUEST_DATA_STREAM";
13459 const EXTRA_CRC: u8 = 148u8;
13460 const ENCODED_LEN: usize = 6usize;
13461 fn deser(
13462 _version: MavlinkVersion,
13463 __input: &[u8],
13464 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13465 let avail_len = __input.len();
13466 let mut payload_buf = [0; Self::ENCODED_LEN];
13467 let mut buf = if avail_len < Self::ENCODED_LEN {
13468 payload_buf[0..avail_len].copy_from_slice(__input);
13469 Bytes::new(&payload_buf)
13470 } else {
13471 Bytes::new(__input)
13472 };
13473 let mut __struct = Self::default();
13474 __struct.req_message_rate = buf.get_u16_le();
13475 __struct.target_system = buf.get_u8();
13476 __struct.target_component = buf.get_u8();
13477 __struct.req_stream_id = buf.get_u8();
13478 __struct.start_stop = buf.get_u8();
13479 Ok(__struct)
13480 }
13481 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13482 let mut __tmp = BytesMut::new(bytes);
13483 #[allow(clippy::absurd_extreme_comparisons)]
13484 #[allow(unused_comparisons)]
13485 if __tmp.remaining() < Self::ENCODED_LEN {
13486 panic!(
13487 "buffer is too small (need {} bytes, but got {})",
13488 Self::ENCODED_LEN,
13489 __tmp.remaining(),
13490 )
13491 }
13492 __tmp.put_u16_le(self.req_message_rate);
13493 __tmp.put_u8(self.target_system);
13494 __tmp.put_u8(self.target_component);
13495 __tmp.put_u8(self.req_stream_id);
13496 __tmp.put_u8(self.start_stop);
13497 if matches!(version, MavlinkVersion::V2) {
13498 let len = __tmp.len();
13499 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13500 } else {
13501 __tmp.len()
13502 }
13503 }
13504}
13505#[doc = "id: 12915"]
13506#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
13507#[derive(Debug, Clone, PartialEq)]
13508#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13509#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13510pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
13511 #[doc = "System ID (0 for broadcast)."]
13512 pub target_system: u8,
13513 #[doc = "Component ID (0 for broadcast)."]
13514 pub target_component: u8,
13515 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
13516 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13517 pub id_or_mac: [u8; 20],
13518 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
13519 pub single_message_size: u8,
13520 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
13521 pub msg_pack_size: u8,
13522 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
13523 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13524 pub messages: [u8; 225],
13525}
13526impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
13527 pub const ENCODED_LEN: usize = 249usize;
13528 pub const DEFAULT: Self = Self {
13529 target_system: 0_u8,
13530 target_component: 0_u8,
13531 id_or_mac: [0_u8; 20usize],
13532 single_message_size: 0_u8,
13533 msg_pack_size: 0_u8,
13534 messages: [0_u8; 225usize],
13535 };
13536 #[cfg(feature = "arbitrary")]
13537 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13538 use arbitrary::{Arbitrary, Unstructured};
13539 let mut buf = [0u8; 1024];
13540 rng.fill_bytes(&mut buf);
13541 let mut unstructured = Unstructured::new(&buf);
13542 Self::arbitrary(&mut unstructured).unwrap_or_default()
13543 }
13544}
13545impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
13546 fn default() -> Self {
13547 Self::DEFAULT.clone()
13548 }
13549}
13550impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
13551 type Message = MavMessage;
13552 const ID: u32 = 12915u32;
13553 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
13554 const EXTRA_CRC: u8 = 94u8;
13555 const ENCODED_LEN: usize = 249usize;
13556 fn deser(
13557 _version: MavlinkVersion,
13558 __input: &[u8],
13559 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13560 let avail_len = __input.len();
13561 let mut payload_buf = [0; Self::ENCODED_LEN];
13562 let mut buf = if avail_len < Self::ENCODED_LEN {
13563 payload_buf[0..avail_len].copy_from_slice(__input);
13564 Bytes::new(&payload_buf)
13565 } else {
13566 Bytes::new(__input)
13567 };
13568 let mut __struct = Self::default();
13569 __struct.target_system = buf.get_u8();
13570 __struct.target_component = buf.get_u8();
13571 for v in &mut __struct.id_or_mac {
13572 let val = buf.get_u8();
13573 *v = val;
13574 }
13575 __struct.single_message_size = buf.get_u8();
13576 __struct.msg_pack_size = buf.get_u8();
13577 for v in &mut __struct.messages {
13578 let val = buf.get_u8();
13579 *v = val;
13580 }
13581 Ok(__struct)
13582 }
13583 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13584 let mut __tmp = BytesMut::new(bytes);
13585 #[allow(clippy::absurd_extreme_comparisons)]
13586 #[allow(unused_comparisons)]
13587 if __tmp.remaining() < Self::ENCODED_LEN {
13588 panic!(
13589 "buffer is too small (need {} bytes, but got {})",
13590 Self::ENCODED_LEN,
13591 __tmp.remaining(),
13592 )
13593 }
13594 __tmp.put_u8(self.target_system);
13595 __tmp.put_u8(self.target_component);
13596 for val in &self.id_or_mac {
13597 __tmp.put_u8(*val);
13598 }
13599 __tmp.put_u8(self.single_message_size);
13600 __tmp.put_u8(self.msg_pack_size);
13601 for val in &self.messages {
13602 __tmp.put_u8(*val);
13603 }
13604 if matches!(version, MavlinkVersion::V2) {
13605 let len = __tmp.len();
13606 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13607 } else {
13608 __tmp.len()
13609 }
13610 }
13611}
13612#[doc = "id: 340"]
13613#[doc = "The global position resulting from GPS and sensor fusion."]
13614#[derive(Debug, Clone, PartialEq)]
13615#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13616#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13617pub struct UTM_GLOBAL_POSITION_DATA {
13618 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
13619 pub time: u64,
13620 #[doc = "Latitude (WGS84)"]
13621 pub lat: i32,
13622 #[doc = "Longitude (WGS84)"]
13623 pub lon: i32,
13624 #[doc = "Altitude (WGS84)"]
13625 pub alt: i32,
13626 #[doc = "Altitude above ground"]
13627 pub relative_alt: i32,
13628 #[doc = "Next waypoint, latitude (WGS84)"]
13629 pub next_lat: i32,
13630 #[doc = "Next waypoint, longitude (WGS84)"]
13631 pub next_lon: i32,
13632 #[doc = "Next waypoint, altitude (WGS84)"]
13633 pub next_alt: i32,
13634 #[doc = "Ground X speed (latitude, positive north)"]
13635 pub vx: i16,
13636 #[doc = "Ground Y speed (longitude, positive east)"]
13637 pub vy: i16,
13638 #[doc = "Ground Z speed (altitude, positive down)"]
13639 pub vz: i16,
13640 #[doc = "Horizontal position uncertainty (standard deviation)"]
13641 pub h_acc: u16,
13642 #[doc = "Altitude uncertainty (standard deviation)"]
13643 pub v_acc: u16,
13644 #[doc = "Speed uncertainty (standard deviation)"]
13645 pub vel_acc: u16,
13646 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
13647 pub update_rate: u16,
13648 #[doc = "Unique UAS ID."]
13649 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13650 pub uas_id: [u8; 18],
13651 #[doc = "Flight state"]
13652 pub flight_state: UtmFlightState,
13653 #[doc = "Bitwise OR combination of the data available flags."]
13654 pub flags: UtmDataAvailFlags,
13655}
13656impl UTM_GLOBAL_POSITION_DATA {
13657 pub const ENCODED_LEN: usize = 70usize;
13658 pub const DEFAULT: Self = Self {
13659 time: 0_u64,
13660 lat: 0_i32,
13661 lon: 0_i32,
13662 alt: 0_i32,
13663 relative_alt: 0_i32,
13664 next_lat: 0_i32,
13665 next_lon: 0_i32,
13666 next_alt: 0_i32,
13667 vx: 0_i16,
13668 vy: 0_i16,
13669 vz: 0_i16,
13670 h_acc: 0_u16,
13671 v_acc: 0_u16,
13672 vel_acc: 0_u16,
13673 update_rate: 0_u16,
13674 uas_id: [0_u8; 18usize],
13675 flight_state: UtmFlightState::DEFAULT,
13676 flags: UtmDataAvailFlags::DEFAULT,
13677 };
13678 #[cfg(feature = "arbitrary")]
13679 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13680 use arbitrary::{Arbitrary, Unstructured};
13681 let mut buf = [0u8; 1024];
13682 rng.fill_bytes(&mut buf);
13683 let mut unstructured = Unstructured::new(&buf);
13684 Self::arbitrary(&mut unstructured).unwrap_or_default()
13685 }
13686}
13687impl Default for UTM_GLOBAL_POSITION_DATA {
13688 fn default() -> Self {
13689 Self::DEFAULT.clone()
13690 }
13691}
13692impl MessageData for UTM_GLOBAL_POSITION_DATA {
13693 type Message = MavMessage;
13694 const ID: u32 = 340u32;
13695 const NAME: &'static str = "UTM_GLOBAL_POSITION";
13696 const EXTRA_CRC: u8 = 99u8;
13697 const ENCODED_LEN: usize = 70usize;
13698 fn deser(
13699 _version: MavlinkVersion,
13700 __input: &[u8],
13701 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13702 let avail_len = __input.len();
13703 let mut payload_buf = [0; Self::ENCODED_LEN];
13704 let mut buf = if avail_len < Self::ENCODED_LEN {
13705 payload_buf[0..avail_len].copy_from_slice(__input);
13706 Bytes::new(&payload_buf)
13707 } else {
13708 Bytes::new(__input)
13709 };
13710 let mut __struct = Self::default();
13711 __struct.time = buf.get_u64_le();
13712 __struct.lat = buf.get_i32_le();
13713 __struct.lon = buf.get_i32_le();
13714 __struct.alt = buf.get_i32_le();
13715 __struct.relative_alt = buf.get_i32_le();
13716 __struct.next_lat = buf.get_i32_le();
13717 __struct.next_lon = buf.get_i32_le();
13718 __struct.next_alt = buf.get_i32_le();
13719 __struct.vx = buf.get_i16_le();
13720 __struct.vy = buf.get_i16_le();
13721 __struct.vz = buf.get_i16_le();
13722 __struct.h_acc = buf.get_u16_le();
13723 __struct.v_acc = buf.get_u16_le();
13724 __struct.vel_acc = buf.get_u16_le();
13725 __struct.update_rate = buf.get_u16_le();
13726 for v in &mut __struct.uas_id {
13727 let val = buf.get_u8();
13728 *v = val;
13729 }
13730 let tmp = buf.get_u8();
13731 __struct.flight_state =
13732 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13733 enum_type: "UtmFlightState",
13734 value: tmp as u32,
13735 })?;
13736 let tmp = buf.get_u8();
13737 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
13738 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13739 flag_type: "UtmDataAvailFlags",
13740 value: tmp as u32,
13741 })?;
13742 Ok(__struct)
13743 }
13744 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13745 let mut __tmp = BytesMut::new(bytes);
13746 #[allow(clippy::absurd_extreme_comparisons)]
13747 #[allow(unused_comparisons)]
13748 if __tmp.remaining() < Self::ENCODED_LEN {
13749 panic!(
13750 "buffer is too small (need {} bytes, but got {})",
13751 Self::ENCODED_LEN,
13752 __tmp.remaining(),
13753 )
13754 }
13755 __tmp.put_u64_le(self.time);
13756 __tmp.put_i32_le(self.lat);
13757 __tmp.put_i32_le(self.lon);
13758 __tmp.put_i32_le(self.alt);
13759 __tmp.put_i32_le(self.relative_alt);
13760 __tmp.put_i32_le(self.next_lat);
13761 __tmp.put_i32_le(self.next_lon);
13762 __tmp.put_i32_le(self.next_alt);
13763 __tmp.put_i16_le(self.vx);
13764 __tmp.put_i16_le(self.vy);
13765 __tmp.put_i16_le(self.vz);
13766 __tmp.put_u16_le(self.h_acc);
13767 __tmp.put_u16_le(self.v_acc);
13768 __tmp.put_u16_le(self.vel_acc);
13769 __tmp.put_u16_le(self.update_rate);
13770 for val in &self.uas_id {
13771 __tmp.put_u8(*val);
13772 }
13773 __tmp.put_u8(self.flight_state as u8);
13774 __tmp.put_u8(self.flags.bits());
13775 if matches!(version, MavlinkVersion::V2) {
13776 let len = __tmp.len();
13777 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13778 } else {
13779 __tmp.len()
13780 }
13781 }
13782}
13783#[doc = "id: 41"]
13784#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
13785#[derive(Debug, Clone, PartialEq)]
13786#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13787#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13788pub struct MISSION_SET_CURRENT_DATA {
13789 #[doc = "Sequence"]
13790 pub seq: u16,
13791 #[doc = "System ID"]
13792 pub target_system: u8,
13793 #[doc = "Component ID"]
13794 pub target_component: u8,
13795}
13796impl MISSION_SET_CURRENT_DATA {
13797 pub const ENCODED_LEN: usize = 4usize;
13798 pub const DEFAULT: Self = Self {
13799 seq: 0_u16,
13800 target_system: 0_u8,
13801 target_component: 0_u8,
13802 };
13803 #[cfg(feature = "arbitrary")]
13804 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13805 use arbitrary::{Arbitrary, Unstructured};
13806 let mut buf = [0u8; 1024];
13807 rng.fill_bytes(&mut buf);
13808 let mut unstructured = Unstructured::new(&buf);
13809 Self::arbitrary(&mut unstructured).unwrap_or_default()
13810 }
13811}
13812impl Default for MISSION_SET_CURRENT_DATA {
13813 fn default() -> Self {
13814 Self::DEFAULT.clone()
13815 }
13816}
13817impl MessageData for MISSION_SET_CURRENT_DATA {
13818 type Message = MavMessage;
13819 const ID: u32 = 41u32;
13820 const NAME: &'static str = "MISSION_SET_CURRENT";
13821 const EXTRA_CRC: u8 = 28u8;
13822 const ENCODED_LEN: usize = 4usize;
13823 fn deser(
13824 _version: MavlinkVersion,
13825 __input: &[u8],
13826 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13827 let avail_len = __input.len();
13828 let mut payload_buf = [0; Self::ENCODED_LEN];
13829 let mut buf = if avail_len < Self::ENCODED_LEN {
13830 payload_buf[0..avail_len].copy_from_slice(__input);
13831 Bytes::new(&payload_buf)
13832 } else {
13833 Bytes::new(__input)
13834 };
13835 let mut __struct = Self::default();
13836 __struct.seq = buf.get_u16_le();
13837 __struct.target_system = buf.get_u8();
13838 __struct.target_component = buf.get_u8();
13839 Ok(__struct)
13840 }
13841 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13842 let mut __tmp = BytesMut::new(bytes);
13843 #[allow(clippy::absurd_extreme_comparisons)]
13844 #[allow(unused_comparisons)]
13845 if __tmp.remaining() < Self::ENCODED_LEN {
13846 panic!(
13847 "buffer is too small (need {} bytes, but got {})",
13848 Self::ENCODED_LEN,
13849 __tmp.remaining(),
13850 )
13851 }
13852 __tmp.put_u16_le(self.seq);
13853 __tmp.put_u8(self.target_system);
13854 __tmp.put_u8(self.target_component);
13855 if matches!(version, MavlinkVersion::V2) {
13856 let len = __tmp.len();
13857 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13858 } else {
13859 __tmp.len()
13860 }
13861 }
13862}
13863#[doc = "id: 231"]
13864#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
13865#[derive(Debug, Clone, PartialEq)]
13866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13867#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13868pub struct WIND_COV_DATA {
13869 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13870 pub time_usec: u64,
13871 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
13872 pub wind_x: f32,
13873 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
13874 pub wind_y: f32,
13875 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
13876 pub wind_z: f32,
13877 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
13878 pub var_horiz: f32,
13879 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
13880 pub var_vert: f32,
13881 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
13882 pub wind_alt: f32,
13883 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
13884 pub horiz_accuracy: f32,
13885 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
13886 pub vert_accuracy: f32,
13887}
13888impl WIND_COV_DATA {
13889 pub const ENCODED_LEN: usize = 40usize;
13890 pub const DEFAULT: Self = Self {
13891 time_usec: 0_u64,
13892 wind_x: 0.0_f32,
13893 wind_y: 0.0_f32,
13894 wind_z: 0.0_f32,
13895 var_horiz: 0.0_f32,
13896 var_vert: 0.0_f32,
13897 wind_alt: 0.0_f32,
13898 horiz_accuracy: 0.0_f32,
13899 vert_accuracy: 0.0_f32,
13900 };
13901 #[cfg(feature = "arbitrary")]
13902 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13903 use arbitrary::{Arbitrary, Unstructured};
13904 let mut buf = [0u8; 1024];
13905 rng.fill_bytes(&mut buf);
13906 let mut unstructured = Unstructured::new(&buf);
13907 Self::arbitrary(&mut unstructured).unwrap_or_default()
13908 }
13909}
13910impl Default for WIND_COV_DATA {
13911 fn default() -> Self {
13912 Self::DEFAULT.clone()
13913 }
13914}
13915impl MessageData for WIND_COV_DATA {
13916 type Message = MavMessage;
13917 const ID: u32 = 231u32;
13918 const NAME: &'static str = "WIND_COV";
13919 const EXTRA_CRC: u8 = 105u8;
13920 const ENCODED_LEN: usize = 40usize;
13921 fn deser(
13922 _version: MavlinkVersion,
13923 __input: &[u8],
13924 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13925 let avail_len = __input.len();
13926 let mut payload_buf = [0; Self::ENCODED_LEN];
13927 let mut buf = if avail_len < Self::ENCODED_LEN {
13928 payload_buf[0..avail_len].copy_from_slice(__input);
13929 Bytes::new(&payload_buf)
13930 } else {
13931 Bytes::new(__input)
13932 };
13933 let mut __struct = Self::default();
13934 __struct.time_usec = buf.get_u64_le();
13935 __struct.wind_x = buf.get_f32_le();
13936 __struct.wind_y = buf.get_f32_le();
13937 __struct.wind_z = buf.get_f32_le();
13938 __struct.var_horiz = buf.get_f32_le();
13939 __struct.var_vert = buf.get_f32_le();
13940 __struct.wind_alt = buf.get_f32_le();
13941 __struct.horiz_accuracy = buf.get_f32_le();
13942 __struct.vert_accuracy = buf.get_f32_le();
13943 Ok(__struct)
13944 }
13945 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13946 let mut __tmp = BytesMut::new(bytes);
13947 #[allow(clippy::absurd_extreme_comparisons)]
13948 #[allow(unused_comparisons)]
13949 if __tmp.remaining() < Self::ENCODED_LEN {
13950 panic!(
13951 "buffer is too small (need {} bytes, but got {})",
13952 Self::ENCODED_LEN,
13953 __tmp.remaining(),
13954 )
13955 }
13956 __tmp.put_u64_le(self.time_usec);
13957 __tmp.put_f32_le(self.wind_x);
13958 __tmp.put_f32_le(self.wind_y);
13959 __tmp.put_f32_le(self.wind_z);
13960 __tmp.put_f32_le(self.var_horiz);
13961 __tmp.put_f32_le(self.var_vert);
13962 __tmp.put_f32_le(self.wind_alt);
13963 __tmp.put_f32_le(self.horiz_accuracy);
13964 __tmp.put_f32_le(self.vert_accuracy);
13965 if matches!(version, MavlinkVersion::V2) {
13966 let len = __tmp.len();
13967 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13968 } else {
13969 __tmp.len()
13970 }
13971 }
13972}
13973#[doc = "id: 21"]
13974#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
13975#[derive(Debug, Clone, PartialEq)]
13976#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13977#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13978pub struct PARAM_REQUEST_LIST_DATA {
13979 #[doc = "System ID"]
13980 pub target_system: u8,
13981 #[doc = "Component ID"]
13982 pub target_component: u8,
13983}
13984impl PARAM_REQUEST_LIST_DATA {
13985 pub const ENCODED_LEN: usize = 2usize;
13986 pub const DEFAULT: Self = Self {
13987 target_system: 0_u8,
13988 target_component: 0_u8,
13989 };
13990 #[cfg(feature = "arbitrary")]
13991 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13992 use arbitrary::{Arbitrary, Unstructured};
13993 let mut buf = [0u8; 1024];
13994 rng.fill_bytes(&mut buf);
13995 let mut unstructured = Unstructured::new(&buf);
13996 Self::arbitrary(&mut unstructured).unwrap_or_default()
13997 }
13998}
13999impl Default for PARAM_REQUEST_LIST_DATA {
14000 fn default() -> Self {
14001 Self::DEFAULT.clone()
14002 }
14003}
14004impl MessageData for PARAM_REQUEST_LIST_DATA {
14005 type Message = MavMessage;
14006 const ID: u32 = 21u32;
14007 const NAME: &'static str = "PARAM_REQUEST_LIST";
14008 const EXTRA_CRC: u8 = 159u8;
14009 const ENCODED_LEN: usize = 2usize;
14010 fn deser(
14011 _version: MavlinkVersion,
14012 __input: &[u8],
14013 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14014 let avail_len = __input.len();
14015 let mut payload_buf = [0; Self::ENCODED_LEN];
14016 let mut buf = if avail_len < Self::ENCODED_LEN {
14017 payload_buf[0..avail_len].copy_from_slice(__input);
14018 Bytes::new(&payload_buf)
14019 } else {
14020 Bytes::new(__input)
14021 };
14022 let mut __struct = Self::default();
14023 __struct.target_system = buf.get_u8();
14024 __struct.target_component = buf.get_u8();
14025 Ok(__struct)
14026 }
14027 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14028 let mut __tmp = BytesMut::new(bytes);
14029 #[allow(clippy::absurd_extreme_comparisons)]
14030 #[allow(unused_comparisons)]
14031 if __tmp.remaining() < Self::ENCODED_LEN {
14032 panic!(
14033 "buffer is too small (need {} bytes, but got {})",
14034 Self::ENCODED_LEN,
14035 __tmp.remaining(),
14036 )
14037 }
14038 __tmp.put_u8(self.target_system);
14039 __tmp.put_u8(self.target_component);
14040 if matches!(version, MavlinkVersion::V2) {
14041 let len = __tmp.len();
14042 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14043 } else {
14044 __tmp.len()
14045 }
14046 }
14047}
14048#[doc = "id: 149"]
14049#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
14050#[derive(Debug, Clone, PartialEq)]
14051#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14052#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14053pub struct LANDING_TARGET_DATA {
14054 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14055 pub time_usec: u64,
14056 #[doc = "X-axis angular offset of the target from the center of the image"]
14057 pub angle_x: f32,
14058 #[doc = "Y-axis angular offset of the target from the center of the image"]
14059 pub angle_y: f32,
14060 #[doc = "Distance to the target from the vehicle"]
14061 pub distance: f32,
14062 #[doc = "Size of target along x-axis"]
14063 pub size_x: f32,
14064 #[doc = "Size of target along y-axis"]
14065 pub size_y: f32,
14066 #[doc = "The ID of the target if multiple targets are present"]
14067 pub target_num: u8,
14068 #[doc = "Coordinate frame used for following fields."]
14069 pub frame: MavFrame,
14070 #[doc = "X Position of the landing target in MAV_FRAME"]
14071 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14072 pub x: f32,
14073 #[doc = "Y Position of the landing target in MAV_FRAME"]
14074 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14075 pub y: f32,
14076 #[doc = "Z Position of the landing target in MAV_FRAME"]
14077 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14078 pub z: f32,
14079 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
14080 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14081 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14082 pub q: [f32; 4],
14083 #[doc = "Type of landing target"]
14084 #[cfg_attr(feature = "serde", serde(default))]
14085 pub mavtype: LandingTargetType,
14086 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
14087 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14088 pub position_valid: u8,
14089}
14090impl LANDING_TARGET_DATA {
14091 pub const ENCODED_LEN: usize = 60usize;
14092 pub const DEFAULT: Self = Self {
14093 time_usec: 0_u64,
14094 angle_x: 0.0_f32,
14095 angle_y: 0.0_f32,
14096 distance: 0.0_f32,
14097 size_x: 0.0_f32,
14098 size_y: 0.0_f32,
14099 target_num: 0_u8,
14100 frame: MavFrame::DEFAULT,
14101 x: 0.0_f32,
14102 y: 0.0_f32,
14103 z: 0.0_f32,
14104 q: [0.0_f32; 4usize],
14105 mavtype: LandingTargetType::DEFAULT,
14106 position_valid: 0_u8,
14107 };
14108 #[cfg(feature = "arbitrary")]
14109 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14110 use arbitrary::{Arbitrary, Unstructured};
14111 let mut buf = [0u8; 1024];
14112 rng.fill_bytes(&mut buf);
14113 let mut unstructured = Unstructured::new(&buf);
14114 Self::arbitrary(&mut unstructured).unwrap_or_default()
14115 }
14116}
14117impl Default for LANDING_TARGET_DATA {
14118 fn default() -> Self {
14119 Self::DEFAULT.clone()
14120 }
14121}
14122impl MessageData for LANDING_TARGET_DATA {
14123 type Message = MavMessage;
14124 const ID: u32 = 149u32;
14125 const NAME: &'static str = "LANDING_TARGET";
14126 const EXTRA_CRC: u8 = 200u8;
14127 const ENCODED_LEN: usize = 60usize;
14128 fn deser(
14129 _version: MavlinkVersion,
14130 __input: &[u8],
14131 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14132 let avail_len = __input.len();
14133 let mut payload_buf = [0; Self::ENCODED_LEN];
14134 let mut buf = if avail_len < Self::ENCODED_LEN {
14135 payload_buf[0..avail_len].copy_from_slice(__input);
14136 Bytes::new(&payload_buf)
14137 } else {
14138 Bytes::new(__input)
14139 };
14140 let mut __struct = Self::default();
14141 __struct.time_usec = buf.get_u64_le();
14142 __struct.angle_x = buf.get_f32_le();
14143 __struct.angle_y = buf.get_f32_le();
14144 __struct.distance = buf.get_f32_le();
14145 __struct.size_x = buf.get_f32_le();
14146 __struct.size_y = buf.get_f32_le();
14147 __struct.target_num = buf.get_u8();
14148 let tmp = buf.get_u8();
14149 __struct.frame =
14150 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14151 enum_type: "MavFrame",
14152 value: tmp as u32,
14153 })?;
14154 __struct.x = buf.get_f32_le();
14155 __struct.y = buf.get_f32_le();
14156 __struct.z = buf.get_f32_le();
14157 for v in &mut __struct.q {
14158 let val = buf.get_f32_le();
14159 *v = val;
14160 }
14161 let tmp = buf.get_u8();
14162 __struct.mavtype =
14163 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14164 enum_type: "LandingTargetType",
14165 value: tmp as u32,
14166 })?;
14167 __struct.position_valid = buf.get_u8();
14168 Ok(__struct)
14169 }
14170 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14171 let mut __tmp = BytesMut::new(bytes);
14172 #[allow(clippy::absurd_extreme_comparisons)]
14173 #[allow(unused_comparisons)]
14174 if __tmp.remaining() < Self::ENCODED_LEN {
14175 panic!(
14176 "buffer is too small (need {} bytes, but got {})",
14177 Self::ENCODED_LEN,
14178 __tmp.remaining(),
14179 )
14180 }
14181 __tmp.put_u64_le(self.time_usec);
14182 __tmp.put_f32_le(self.angle_x);
14183 __tmp.put_f32_le(self.angle_y);
14184 __tmp.put_f32_le(self.distance);
14185 __tmp.put_f32_le(self.size_x);
14186 __tmp.put_f32_le(self.size_y);
14187 __tmp.put_u8(self.target_num);
14188 __tmp.put_u8(self.frame as u8);
14189 __tmp.put_f32_le(self.x);
14190 __tmp.put_f32_le(self.y);
14191 __tmp.put_f32_le(self.z);
14192 for val in &self.q {
14193 __tmp.put_f32_le(*val);
14194 }
14195 __tmp.put_u8(self.mavtype as u8);
14196 __tmp.put_u8(self.position_valid);
14197 if matches!(version, MavlinkVersion::V2) {
14198 let len = __tmp.len();
14199 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14200 } else {
14201 __tmp.len()
14202 }
14203 }
14204}
14205#[doc = "id: 335"]
14206#[doc = "Status of the Iridium SBD link."]
14207#[derive(Debug, Clone, PartialEq)]
14208#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14210pub struct ISBD_LINK_STATUS_DATA {
14211 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14212 pub timestamp: u64,
14213 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14214 pub last_heartbeat: u64,
14215 #[doc = "Number of failed SBD sessions."]
14216 pub failed_sessions: u16,
14217 #[doc = "Number of successful SBD sessions."]
14218 pub successful_sessions: u16,
14219 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
14220 pub signal_quality: u8,
14221 #[doc = "1: Ring call pending, 0: No call pending."]
14222 pub ring_pending: u8,
14223 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
14224 pub tx_session_pending: u8,
14225 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
14226 pub rx_session_pending: u8,
14227}
14228impl ISBD_LINK_STATUS_DATA {
14229 pub const ENCODED_LEN: usize = 24usize;
14230 pub const DEFAULT: Self = Self {
14231 timestamp: 0_u64,
14232 last_heartbeat: 0_u64,
14233 failed_sessions: 0_u16,
14234 successful_sessions: 0_u16,
14235 signal_quality: 0_u8,
14236 ring_pending: 0_u8,
14237 tx_session_pending: 0_u8,
14238 rx_session_pending: 0_u8,
14239 };
14240 #[cfg(feature = "arbitrary")]
14241 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14242 use arbitrary::{Arbitrary, Unstructured};
14243 let mut buf = [0u8; 1024];
14244 rng.fill_bytes(&mut buf);
14245 let mut unstructured = Unstructured::new(&buf);
14246 Self::arbitrary(&mut unstructured).unwrap_or_default()
14247 }
14248}
14249impl Default for ISBD_LINK_STATUS_DATA {
14250 fn default() -> Self {
14251 Self::DEFAULT.clone()
14252 }
14253}
14254impl MessageData for ISBD_LINK_STATUS_DATA {
14255 type Message = MavMessage;
14256 const ID: u32 = 335u32;
14257 const NAME: &'static str = "ISBD_LINK_STATUS";
14258 const EXTRA_CRC: u8 = 225u8;
14259 const ENCODED_LEN: usize = 24usize;
14260 fn deser(
14261 _version: MavlinkVersion,
14262 __input: &[u8],
14263 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14264 let avail_len = __input.len();
14265 let mut payload_buf = [0; Self::ENCODED_LEN];
14266 let mut buf = if avail_len < Self::ENCODED_LEN {
14267 payload_buf[0..avail_len].copy_from_slice(__input);
14268 Bytes::new(&payload_buf)
14269 } else {
14270 Bytes::new(__input)
14271 };
14272 let mut __struct = Self::default();
14273 __struct.timestamp = buf.get_u64_le();
14274 __struct.last_heartbeat = buf.get_u64_le();
14275 __struct.failed_sessions = buf.get_u16_le();
14276 __struct.successful_sessions = buf.get_u16_le();
14277 __struct.signal_quality = buf.get_u8();
14278 __struct.ring_pending = buf.get_u8();
14279 __struct.tx_session_pending = buf.get_u8();
14280 __struct.rx_session_pending = buf.get_u8();
14281 Ok(__struct)
14282 }
14283 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14284 let mut __tmp = BytesMut::new(bytes);
14285 #[allow(clippy::absurd_extreme_comparisons)]
14286 #[allow(unused_comparisons)]
14287 if __tmp.remaining() < Self::ENCODED_LEN {
14288 panic!(
14289 "buffer is too small (need {} bytes, but got {})",
14290 Self::ENCODED_LEN,
14291 __tmp.remaining(),
14292 )
14293 }
14294 __tmp.put_u64_le(self.timestamp);
14295 __tmp.put_u64_le(self.last_heartbeat);
14296 __tmp.put_u16_le(self.failed_sessions);
14297 __tmp.put_u16_le(self.successful_sessions);
14298 __tmp.put_u8(self.signal_quality);
14299 __tmp.put_u8(self.ring_pending);
14300 __tmp.put_u8(self.tx_session_pending);
14301 __tmp.put_u8(self.rx_session_pending);
14302 if matches!(version, MavlinkVersion::V2) {
14303 let len = __tmp.len();
14304 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14305 } else {
14306 __tmp.len()
14307 }
14308 }
14309}
14310#[doc = "id: 84"]
14311#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
14312#[derive(Debug, Clone, PartialEq)]
14313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14314#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14315pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
14316 #[doc = "Timestamp (time since system boot)."]
14317 pub time_boot_ms: u32,
14318 #[doc = "X Position in NED frame"]
14319 pub x: f32,
14320 #[doc = "Y Position in NED frame"]
14321 pub y: f32,
14322 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
14323 pub z: f32,
14324 #[doc = "X velocity in NED frame"]
14325 pub vx: f32,
14326 #[doc = "Y velocity in NED frame"]
14327 pub vy: f32,
14328 #[doc = "Z velocity in NED frame"]
14329 pub vz: f32,
14330 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
14331 pub afx: f32,
14332 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
14333 pub afy: f32,
14334 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
14335 pub afz: f32,
14336 #[doc = "yaw setpoint"]
14337 pub yaw: f32,
14338 #[doc = "yaw rate setpoint"]
14339 pub yaw_rate: f32,
14340 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
14341 pub type_mask: PositionTargetTypemask,
14342 #[doc = "System ID"]
14343 pub target_system: u8,
14344 #[doc = "Component ID"]
14345 pub target_component: u8,
14346 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
14347 pub coordinate_frame: MavFrame,
14348}
14349impl SET_POSITION_TARGET_LOCAL_NED_DATA {
14350 pub const ENCODED_LEN: usize = 53usize;
14351 pub const DEFAULT: Self = Self {
14352 time_boot_ms: 0_u32,
14353 x: 0.0_f32,
14354 y: 0.0_f32,
14355 z: 0.0_f32,
14356 vx: 0.0_f32,
14357 vy: 0.0_f32,
14358 vz: 0.0_f32,
14359 afx: 0.0_f32,
14360 afy: 0.0_f32,
14361 afz: 0.0_f32,
14362 yaw: 0.0_f32,
14363 yaw_rate: 0.0_f32,
14364 type_mask: PositionTargetTypemask::DEFAULT,
14365 target_system: 0_u8,
14366 target_component: 0_u8,
14367 coordinate_frame: MavFrame::DEFAULT,
14368 };
14369 #[cfg(feature = "arbitrary")]
14370 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14371 use arbitrary::{Arbitrary, Unstructured};
14372 let mut buf = [0u8; 1024];
14373 rng.fill_bytes(&mut buf);
14374 let mut unstructured = Unstructured::new(&buf);
14375 Self::arbitrary(&mut unstructured).unwrap_or_default()
14376 }
14377}
14378impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
14379 fn default() -> Self {
14380 Self::DEFAULT.clone()
14381 }
14382}
14383impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
14384 type Message = MavMessage;
14385 const ID: u32 = 84u32;
14386 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
14387 const EXTRA_CRC: u8 = 143u8;
14388 const ENCODED_LEN: usize = 53usize;
14389 fn deser(
14390 _version: MavlinkVersion,
14391 __input: &[u8],
14392 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14393 let avail_len = __input.len();
14394 let mut payload_buf = [0; Self::ENCODED_LEN];
14395 let mut buf = if avail_len < Self::ENCODED_LEN {
14396 payload_buf[0..avail_len].copy_from_slice(__input);
14397 Bytes::new(&payload_buf)
14398 } else {
14399 Bytes::new(__input)
14400 };
14401 let mut __struct = Self::default();
14402 __struct.time_boot_ms = buf.get_u32_le();
14403 __struct.x = buf.get_f32_le();
14404 __struct.y = buf.get_f32_le();
14405 __struct.z = buf.get_f32_le();
14406 __struct.vx = buf.get_f32_le();
14407 __struct.vy = buf.get_f32_le();
14408 __struct.vz = buf.get_f32_le();
14409 __struct.afx = buf.get_f32_le();
14410 __struct.afy = buf.get_f32_le();
14411 __struct.afz = buf.get_f32_le();
14412 __struct.yaw = buf.get_f32_le();
14413 __struct.yaw_rate = buf.get_f32_le();
14414 let tmp = buf.get_u16_le();
14415 __struct.type_mask = PositionTargetTypemask::from_bits(
14416 tmp & PositionTargetTypemask::all().bits(),
14417 )
14418 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14419 flag_type: "PositionTargetTypemask",
14420 value: tmp as u32,
14421 })?;
14422 __struct.target_system = buf.get_u8();
14423 __struct.target_component = buf.get_u8();
14424 let tmp = buf.get_u8();
14425 __struct.coordinate_frame =
14426 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14427 enum_type: "MavFrame",
14428 value: tmp as u32,
14429 })?;
14430 Ok(__struct)
14431 }
14432 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14433 let mut __tmp = BytesMut::new(bytes);
14434 #[allow(clippy::absurd_extreme_comparisons)]
14435 #[allow(unused_comparisons)]
14436 if __tmp.remaining() < Self::ENCODED_LEN {
14437 panic!(
14438 "buffer is too small (need {} bytes, but got {})",
14439 Self::ENCODED_LEN,
14440 __tmp.remaining(),
14441 )
14442 }
14443 __tmp.put_u32_le(self.time_boot_ms);
14444 __tmp.put_f32_le(self.x);
14445 __tmp.put_f32_le(self.y);
14446 __tmp.put_f32_le(self.z);
14447 __tmp.put_f32_le(self.vx);
14448 __tmp.put_f32_le(self.vy);
14449 __tmp.put_f32_le(self.vz);
14450 __tmp.put_f32_le(self.afx);
14451 __tmp.put_f32_le(self.afy);
14452 __tmp.put_f32_le(self.afz);
14453 __tmp.put_f32_le(self.yaw);
14454 __tmp.put_f32_le(self.yaw_rate);
14455 __tmp.put_u16_le(self.type_mask.bits());
14456 __tmp.put_u8(self.target_system);
14457 __tmp.put_u8(self.target_component);
14458 __tmp.put_u8(self.coordinate_frame as u8);
14459 if matches!(version, MavlinkVersion::V2) {
14460 let len = __tmp.len();
14461 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14462 } else {
14463 __tmp.len()
14464 }
14465 }
14466}
14467#[doc = "id: 263"]
14468#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
14469#[derive(Debug, Clone, PartialEq)]
14470#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14471#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14472pub struct CAMERA_IMAGE_CAPTURED_DATA {
14473 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
14474 pub time_utc: u64,
14475 #[doc = "Timestamp (time since system boot)."]
14476 pub time_boot_ms: u32,
14477 #[doc = "Latitude where image was taken"]
14478 pub lat: i32,
14479 #[doc = "Longitude where capture was taken"]
14480 pub lon: i32,
14481 #[doc = "Altitude (MSL) where image was taken"]
14482 pub alt: i32,
14483 #[doc = "Altitude above ground"]
14484 pub relative_alt: i32,
14485 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
14486 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14487 pub q: [f32; 4],
14488 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
14489 pub image_index: i32,
14490 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
14491 pub camera_id: u8,
14492 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
14493 pub capture_result: i8,
14494 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
14495 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14496 pub file_url: [u8; 205],
14497}
14498impl CAMERA_IMAGE_CAPTURED_DATA {
14499 pub const ENCODED_LEN: usize = 255usize;
14500 pub const DEFAULT: Self = Self {
14501 time_utc: 0_u64,
14502 time_boot_ms: 0_u32,
14503 lat: 0_i32,
14504 lon: 0_i32,
14505 alt: 0_i32,
14506 relative_alt: 0_i32,
14507 q: [0.0_f32; 4usize],
14508 image_index: 0_i32,
14509 camera_id: 0_u8,
14510 capture_result: 0_i8,
14511 file_url: [0_u8; 205usize],
14512 };
14513 #[cfg(feature = "arbitrary")]
14514 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14515 use arbitrary::{Arbitrary, Unstructured};
14516 let mut buf = [0u8; 1024];
14517 rng.fill_bytes(&mut buf);
14518 let mut unstructured = Unstructured::new(&buf);
14519 Self::arbitrary(&mut unstructured).unwrap_or_default()
14520 }
14521}
14522impl Default for CAMERA_IMAGE_CAPTURED_DATA {
14523 fn default() -> Self {
14524 Self::DEFAULT.clone()
14525 }
14526}
14527impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
14528 type Message = MavMessage;
14529 const ID: u32 = 263u32;
14530 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
14531 const EXTRA_CRC: u8 = 133u8;
14532 const ENCODED_LEN: usize = 255usize;
14533 fn deser(
14534 _version: MavlinkVersion,
14535 __input: &[u8],
14536 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14537 let avail_len = __input.len();
14538 let mut payload_buf = [0; Self::ENCODED_LEN];
14539 let mut buf = if avail_len < Self::ENCODED_LEN {
14540 payload_buf[0..avail_len].copy_from_slice(__input);
14541 Bytes::new(&payload_buf)
14542 } else {
14543 Bytes::new(__input)
14544 };
14545 let mut __struct = Self::default();
14546 __struct.time_utc = buf.get_u64_le();
14547 __struct.time_boot_ms = buf.get_u32_le();
14548 __struct.lat = buf.get_i32_le();
14549 __struct.lon = buf.get_i32_le();
14550 __struct.alt = buf.get_i32_le();
14551 __struct.relative_alt = buf.get_i32_le();
14552 for v in &mut __struct.q {
14553 let val = buf.get_f32_le();
14554 *v = val;
14555 }
14556 __struct.image_index = buf.get_i32_le();
14557 __struct.camera_id = buf.get_u8();
14558 __struct.capture_result = buf.get_i8();
14559 for v in &mut __struct.file_url {
14560 let val = buf.get_u8();
14561 *v = val;
14562 }
14563 Ok(__struct)
14564 }
14565 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14566 let mut __tmp = BytesMut::new(bytes);
14567 #[allow(clippy::absurd_extreme_comparisons)]
14568 #[allow(unused_comparisons)]
14569 if __tmp.remaining() < Self::ENCODED_LEN {
14570 panic!(
14571 "buffer is too small (need {} bytes, but got {})",
14572 Self::ENCODED_LEN,
14573 __tmp.remaining(),
14574 )
14575 }
14576 __tmp.put_u64_le(self.time_utc);
14577 __tmp.put_u32_le(self.time_boot_ms);
14578 __tmp.put_i32_le(self.lat);
14579 __tmp.put_i32_le(self.lon);
14580 __tmp.put_i32_le(self.alt);
14581 __tmp.put_i32_le(self.relative_alt);
14582 for val in &self.q {
14583 __tmp.put_f32_le(*val);
14584 }
14585 __tmp.put_i32_le(self.image_index);
14586 __tmp.put_u8(self.camera_id);
14587 __tmp.put_i8(self.capture_result);
14588 for val in &self.file_url {
14589 __tmp.put_u8(*val);
14590 }
14591 if matches!(version, MavlinkVersion::V2) {
14592 let len = __tmp.len();
14593 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14594 } else {
14595 __tmp.len()
14596 }
14597 }
14598}
14599#[doc = "id: 301"]
14600#[doc = "The location and information of an AIS vessel."]
14601#[derive(Debug, Clone, PartialEq)]
14602#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14603#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14604pub struct AIS_VESSEL_DATA {
14605 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
14606 pub MMSI: u32,
14607 #[doc = "Latitude"]
14608 pub lat: i32,
14609 #[doc = "Longitude"]
14610 pub lon: i32,
14611 #[doc = "Course over ground"]
14612 pub COG: u16,
14613 #[doc = "True heading"]
14614 pub heading: u16,
14615 #[doc = "Speed over ground"]
14616 pub velocity: u16,
14617 #[doc = "Distance from lat/lon location to bow"]
14618 pub dimension_bow: u16,
14619 #[doc = "Distance from lat/lon location to stern"]
14620 pub dimension_stern: u16,
14621 #[doc = "Time since last communication in seconds"]
14622 pub tslc: u16,
14623 #[doc = "Bitmask to indicate various statuses including valid data fields"]
14624 pub flags: AisFlags,
14625 #[doc = "Turn rate"]
14626 pub turn_rate: i8,
14627 #[doc = "Navigational status"]
14628 pub navigational_status: AisNavStatus,
14629 #[doc = "Type of vessels"]
14630 pub mavtype: AisType,
14631 #[doc = "Distance from lat/lon location to port side"]
14632 pub dimension_port: u8,
14633 #[doc = "Distance from lat/lon location to starboard side"]
14634 pub dimension_starboard: u8,
14635 #[doc = "The vessel callsign"]
14636 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14637 pub callsign: [u8; 7],
14638 #[doc = "The vessel name"]
14639 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14640 pub name: [u8; 20],
14641}
14642impl AIS_VESSEL_DATA {
14643 pub const ENCODED_LEN: usize = 58usize;
14644 pub const DEFAULT: Self = Self {
14645 MMSI: 0_u32,
14646 lat: 0_i32,
14647 lon: 0_i32,
14648 COG: 0_u16,
14649 heading: 0_u16,
14650 velocity: 0_u16,
14651 dimension_bow: 0_u16,
14652 dimension_stern: 0_u16,
14653 tslc: 0_u16,
14654 flags: AisFlags::DEFAULT,
14655 turn_rate: 0_i8,
14656 navigational_status: AisNavStatus::DEFAULT,
14657 mavtype: AisType::DEFAULT,
14658 dimension_port: 0_u8,
14659 dimension_starboard: 0_u8,
14660 callsign: [0_u8; 7usize],
14661 name: [0_u8; 20usize],
14662 };
14663 #[cfg(feature = "arbitrary")]
14664 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14665 use arbitrary::{Arbitrary, Unstructured};
14666 let mut buf = [0u8; 1024];
14667 rng.fill_bytes(&mut buf);
14668 let mut unstructured = Unstructured::new(&buf);
14669 Self::arbitrary(&mut unstructured).unwrap_or_default()
14670 }
14671}
14672impl Default for AIS_VESSEL_DATA {
14673 fn default() -> Self {
14674 Self::DEFAULT.clone()
14675 }
14676}
14677impl MessageData for AIS_VESSEL_DATA {
14678 type Message = MavMessage;
14679 const ID: u32 = 301u32;
14680 const NAME: &'static str = "AIS_VESSEL";
14681 const EXTRA_CRC: u8 = 243u8;
14682 const ENCODED_LEN: usize = 58usize;
14683 fn deser(
14684 _version: MavlinkVersion,
14685 __input: &[u8],
14686 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14687 let avail_len = __input.len();
14688 let mut payload_buf = [0; Self::ENCODED_LEN];
14689 let mut buf = if avail_len < Self::ENCODED_LEN {
14690 payload_buf[0..avail_len].copy_from_slice(__input);
14691 Bytes::new(&payload_buf)
14692 } else {
14693 Bytes::new(__input)
14694 };
14695 let mut __struct = Self::default();
14696 __struct.MMSI = buf.get_u32_le();
14697 __struct.lat = buf.get_i32_le();
14698 __struct.lon = buf.get_i32_le();
14699 __struct.COG = buf.get_u16_le();
14700 __struct.heading = buf.get_u16_le();
14701 __struct.velocity = buf.get_u16_le();
14702 __struct.dimension_bow = buf.get_u16_le();
14703 __struct.dimension_stern = buf.get_u16_le();
14704 __struct.tslc = buf.get_u16_le();
14705 let tmp = buf.get_u16_le();
14706 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
14707 ::mavlink_core::error::ParserError::InvalidFlag {
14708 flag_type: "AisFlags",
14709 value: tmp as u32,
14710 },
14711 )?;
14712 __struct.turn_rate = buf.get_i8();
14713 let tmp = buf.get_u8();
14714 __struct.navigational_status =
14715 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14716 enum_type: "AisNavStatus",
14717 value: tmp as u32,
14718 })?;
14719 let tmp = buf.get_u8();
14720 __struct.mavtype =
14721 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14722 enum_type: "AisType",
14723 value: tmp as u32,
14724 })?;
14725 __struct.dimension_port = buf.get_u8();
14726 __struct.dimension_starboard = buf.get_u8();
14727 for v in &mut __struct.callsign {
14728 let val = buf.get_u8();
14729 *v = val;
14730 }
14731 for v in &mut __struct.name {
14732 let val = buf.get_u8();
14733 *v = val;
14734 }
14735 Ok(__struct)
14736 }
14737 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14738 let mut __tmp = BytesMut::new(bytes);
14739 #[allow(clippy::absurd_extreme_comparisons)]
14740 #[allow(unused_comparisons)]
14741 if __tmp.remaining() < Self::ENCODED_LEN {
14742 panic!(
14743 "buffer is too small (need {} bytes, but got {})",
14744 Self::ENCODED_LEN,
14745 __tmp.remaining(),
14746 )
14747 }
14748 __tmp.put_u32_le(self.MMSI);
14749 __tmp.put_i32_le(self.lat);
14750 __tmp.put_i32_le(self.lon);
14751 __tmp.put_u16_le(self.COG);
14752 __tmp.put_u16_le(self.heading);
14753 __tmp.put_u16_le(self.velocity);
14754 __tmp.put_u16_le(self.dimension_bow);
14755 __tmp.put_u16_le(self.dimension_stern);
14756 __tmp.put_u16_le(self.tslc);
14757 __tmp.put_u16_le(self.flags.bits());
14758 __tmp.put_i8(self.turn_rate);
14759 __tmp.put_u8(self.navigational_status as u8);
14760 __tmp.put_u8(self.mavtype as u8);
14761 __tmp.put_u8(self.dimension_port);
14762 __tmp.put_u8(self.dimension_starboard);
14763 for val in &self.callsign {
14764 __tmp.put_u8(*val);
14765 }
14766 for val in &self.name {
14767 __tmp.put_u8(*val);
14768 }
14769 if matches!(version, MavlinkVersion::V2) {
14770 let len = __tmp.len();
14771 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14772 } else {
14773 __tmp.len()
14774 }
14775 }
14776}
14777#[doc = "id: 282"]
14778#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
14779#[derive(Debug, Clone, PartialEq)]
14780#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14781#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14782pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
14783 #[doc = "High level gimbal manager flags to use."]
14784 pub flags: GimbalManagerFlags,
14785 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
14786 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14787 pub q: [f32; 4],
14788 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
14789 pub angular_velocity_x: f32,
14790 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
14791 pub angular_velocity_y: f32,
14792 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
14793 pub angular_velocity_z: f32,
14794 #[doc = "System ID"]
14795 pub target_system: u8,
14796 #[doc = "Component ID"]
14797 pub target_component: u8,
14798 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
14799 pub gimbal_device_id: u8,
14800}
14801impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
14802 pub const ENCODED_LEN: usize = 35usize;
14803 pub const DEFAULT: Self = Self {
14804 flags: GimbalManagerFlags::DEFAULT,
14805 q: [0.0_f32; 4usize],
14806 angular_velocity_x: 0.0_f32,
14807 angular_velocity_y: 0.0_f32,
14808 angular_velocity_z: 0.0_f32,
14809 target_system: 0_u8,
14810 target_component: 0_u8,
14811 gimbal_device_id: 0_u8,
14812 };
14813 #[cfg(feature = "arbitrary")]
14814 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14815 use arbitrary::{Arbitrary, Unstructured};
14816 let mut buf = [0u8; 1024];
14817 rng.fill_bytes(&mut buf);
14818 let mut unstructured = Unstructured::new(&buf);
14819 Self::arbitrary(&mut unstructured).unwrap_or_default()
14820 }
14821}
14822impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
14823 fn default() -> Self {
14824 Self::DEFAULT.clone()
14825 }
14826}
14827impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
14828 type Message = MavMessage;
14829 const ID: u32 = 282u32;
14830 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
14831 const EXTRA_CRC: u8 = 123u8;
14832 const ENCODED_LEN: usize = 35usize;
14833 fn deser(
14834 _version: MavlinkVersion,
14835 __input: &[u8],
14836 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14837 let avail_len = __input.len();
14838 let mut payload_buf = [0; Self::ENCODED_LEN];
14839 let mut buf = if avail_len < Self::ENCODED_LEN {
14840 payload_buf[0..avail_len].copy_from_slice(__input);
14841 Bytes::new(&payload_buf)
14842 } else {
14843 Bytes::new(__input)
14844 };
14845 let mut __struct = Self::default();
14846 let tmp = buf.get_u32_le();
14847 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
14848 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14849 flag_type: "GimbalManagerFlags",
14850 value: tmp as u32,
14851 })?;
14852 for v in &mut __struct.q {
14853 let val = buf.get_f32_le();
14854 *v = val;
14855 }
14856 __struct.angular_velocity_x = buf.get_f32_le();
14857 __struct.angular_velocity_y = buf.get_f32_le();
14858 __struct.angular_velocity_z = buf.get_f32_le();
14859 __struct.target_system = buf.get_u8();
14860 __struct.target_component = buf.get_u8();
14861 __struct.gimbal_device_id = buf.get_u8();
14862 Ok(__struct)
14863 }
14864 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14865 let mut __tmp = BytesMut::new(bytes);
14866 #[allow(clippy::absurd_extreme_comparisons)]
14867 #[allow(unused_comparisons)]
14868 if __tmp.remaining() < Self::ENCODED_LEN {
14869 panic!(
14870 "buffer is too small (need {} bytes, but got {})",
14871 Self::ENCODED_LEN,
14872 __tmp.remaining(),
14873 )
14874 }
14875 __tmp.put_u32_le(self.flags.bits());
14876 for val in &self.q {
14877 __tmp.put_f32_le(*val);
14878 }
14879 __tmp.put_f32_le(self.angular_velocity_x);
14880 __tmp.put_f32_le(self.angular_velocity_y);
14881 __tmp.put_f32_le(self.angular_velocity_z);
14882 __tmp.put_u8(self.target_system);
14883 __tmp.put_u8(self.target_component);
14884 __tmp.put_u8(self.gimbal_device_id);
14885 if matches!(version, MavlinkVersion::V2) {
14886 let len = __tmp.len();
14887 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14888 } else {
14889 __tmp.len()
14890 }
14891 }
14892}
14893#[doc = "id: 281"]
14894#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
14895#[derive(Debug, Clone, PartialEq)]
14896#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14897#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14898pub struct GIMBAL_MANAGER_STATUS_DATA {
14899 #[doc = "Timestamp (time since system boot)."]
14900 pub time_boot_ms: u32,
14901 #[doc = "High level gimbal manager flags currently applied."]
14902 pub flags: GimbalManagerFlags,
14903 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
14904 pub gimbal_device_id: u8,
14905 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
14906 pub primary_control_sysid: u8,
14907 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
14908 pub primary_control_compid: u8,
14909 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
14910 pub secondary_control_sysid: u8,
14911 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
14912 pub secondary_control_compid: u8,
14913}
14914impl GIMBAL_MANAGER_STATUS_DATA {
14915 pub const ENCODED_LEN: usize = 13usize;
14916 pub const DEFAULT: Self = Self {
14917 time_boot_ms: 0_u32,
14918 flags: GimbalManagerFlags::DEFAULT,
14919 gimbal_device_id: 0_u8,
14920 primary_control_sysid: 0_u8,
14921 primary_control_compid: 0_u8,
14922 secondary_control_sysid: 0_u8,
14923 secondary_control_compid: 0_u8,
14924 };
14925 #[cfg(feature = "arbitrary")]
14926 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14927 use arbitrary::{Arbitrary, Unstructured};
14928 let mut buf = [0u8; 1024];
14929 rng.fill_bytes(&mut buf);
14930 let mut unstructured = Unstructured::new(&buf);
14931 Self::arbitrary(&mut unstructured).unwrap_or_default()
14932 }
14933}
14934impl Default for GIMBAL_MANAGER_STATUS_DATA {
14935 fn default() -> Self {
14936 Self::DEFAULT.clone()
14937 }
14938}
14939impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
14940 type Message = MavMessage;
14941 const ID: u32 = 281u32;
14942 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
14943 const EXTRA_CRC: u8 = 48u8;
14944 const ENCODED_LEN: usize = 13usize;
14945 fn deser(
14946 _version: MavlinkVersion,
14947 __input: &[u8],
14948 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14949 let avail_len = __input.len();
14950 let mut payload_buf = [0; Self::ENCODED_LEN];
14951 let mut buf = if avail_len < Self::ENCODED_LEN {
14952 payload_buf[0..avail_len].copy_from_slice(__input);
14953 Bytes::new(&payload_buf)
14954 } else {
14955 Bytes::new(__input)
14956 };
14957 let mut __struct = Self::default();
14958 __struct.time_boot_ms = buf.get_u32_le();
14959 let tmp = buf.get_u32_le();
14960 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
14961 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14962 flag_type: "GimbalManagerFlags",
14963 value: tmp as u32,
14964 })?;
14965 __struct.gimbal_device_id = buf.get_u8();
14966 __struct.primary_control_sysid = buf.get_u8();
14967 __struct.primary_control_compid = buf.get_u8();
14968 __struct.secondary_control_sysid = buf.get_u8();
14969 __struct.secondary_control_compid = buf.get_u8();
14970 Ok(__struct)
14971 }
14972 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14973 let mut __tmp = BytesMut::new(bytes);
14974 #[allow(clippy::absurd_extreme_comparisons)]
14975 #[allow(unused_comparisons)]
14976 if __tmp.remaining() < Self::ENCODED_LEN {
14977 panic!(
14978 "buffer is too small (need {} bytes, but got {})",
14979 Self::ENCODED_LEN,
14980 __tmp.remaining(),
14981 )
14982 }
14983 __tmp.put_u32_le(self.time_boot_ms);
14984 __tmp.put_u32_le(self.flags.bits());
14985 __tmp.put_u8(self.gimbal_device_id);
14986 __tmp.put_u8(self.primary_control_sysid);
14987 __tmp.put_u8(self.primary_control_compid);
14988 __tmp.put_u8(self.secondary_control_sysid);
14989 __tmp.put_u8(self.secondary_control_compid);
14990 if matches!(version, MavlinkVersion::V2) {
14991 let len = __tmp.len();
14992 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14993 } else {
14994 __tmp.len()
14995 }
14996 }
14997}
14998#[doc = "id: 400"]
14999#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
15000#[derive(Debug, Clone, PartialEq)]
15001#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15002#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15003pub struct PLAY_TUNE_V2_DATA {
15004 #[doc = "Tune format"]
15005 pub format: TuneFormat,
15006 #[doc = "System ID"]
15007 pub target_system: u8,
15008 #[doc = "Component ID"]
15009 pub target_component: u8,
15010 #[doc = "Tune definition as a NULL-terminated string."]
15011 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15012 pub tune: [u8; 248],
15013}
15014impl PLAY_TUNE_V2_DATA {
15015 pub const ENCODED_LEN: usize = 254usize;
15016 pub const DEFAULT: Self = Self {
15017 format: TuneFormat::DEFAULT,
15018 target_system: 0_u8,
15019 target_component: 0_u8,
15020 tune: [0_u8; 248usize],
15021 };
15022 #[cfg(feature = "arbitrary")]
15023 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15024 use arbitrary::{Arbitrary, Unstructured};
15025 let mut buf = [0u8; 1024];
15026 rng.fill_bytes(&mut buf);
15027 let mut unstructured = Unstructured::new(&buf);
15028 Self::arbitrary(&mut unstructured).unwrap_or_default()
15029 }
15030}
15031impl Default for PLAY_TUNE_V2_DATA {
15032 fn default() -> Self {
15033 Self::DEFAULT.clone()
15034 }
15035}
15036impl MessageData for PLAY_TUNE_V2_DATA {
15037 type Message = MavMessage;
15038 const ID: u32 = 400u32;
15039 const NAME: &'static str = "PLAY_TUNE_V2";
15040 const EXTRA_CRC: u8 = 110u8;
15041 const ENCODED_LEN: usize = 254usize;
15042 fn deser(
15043 _version: MavlinkVersion,
15044 __input: &[u8],
15045 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15046 let avail_len = __input.len();
15047 let mut payload_buf = [0; Self::ENCODED_LEN];
15048 let mut buf = if avail_len < Self::ENCODED_LEN {
15049 payload_buf[0..avail_len].copy_from_slice(__input);
15050 Bytes::new(&payload_buf)
15051 } else {
15052 Bytes::new(__input)
15053 };
15054 let mut __struct = Self::default();
15055 let tmp = buf.get_u32_le();
15056 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
15057 ::mavlink_core::error::ParserError::InvalidEnum {
15058 enum_type: "TuneFormat",
15059 value: tmp as u32,
15060 },
15061 )?;
15062 __struct.target_system = buf.get_u8();
15063 __struct.target_component = buf.get_u8();
15064 for v in &mut __struct.tune {
15065 let val = buf.get_u8();
15066 *v = val;
15067 }
15068 Ok(__struct)
15069 }
15070 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15071 let mut __tmp = BytesMut::new(bytes);
15072 #[allow(clippy::absurd_extreme_comparisons)]
15073 #[allow(unused_comparisons)]
15074 if __tmp.remaining() < Self::ENCODED_LEN {
15075 panic!(
15076 "buffer is too small (need {} bytes, but got {})",
15077 Self::ENCODED_LEN,
15078 __tmp.remaining(),
15079 )
15080 }
15081 __tmp.put_u32_le(self.format as u32);
15082 __tmp.put_u8(self.target_system);
15083 __tmp.put_u8(self.target_component);
15084 for val in &self.tune {
15085 __tmp.put_u8(*val);
15086 }
15087 if matches!(version, MavlinkVersion::V2) {
15088 let len = __tmp.len();
15089 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15090 } else {
15091 __tmp.len()
15092 }
15093 }
15094}
15095#[doc = "id: 105"]
15096#[doc = "The IMU readings in SI units in NED body frame."]
15097#[derive(Debug, Clone, PartialEq)]
15098#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15099#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15100pub struct HIGHRES_IMU_DATA {
15101 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15102 pub time_usec: u64,
15103 #[doc = "X acceleration"]
15104 pub xacc: f32,
15105 #[doc = "Y acceleration"]
15106 pub yacc: f32,
15107 #[doc = "Z acceleration"]
15108 pub zacc: f32,
15109 #[doc = "Angular speed around X axis"]
15110 pub xgyro: f32,
15111 #[doc = "Angular speed around Y axis"]
15112 pub ygyro: f32,
15113 #[doc = "Angular speed around Z axis"]
15114 pub zgyro: f32,
15115 #[doc = "X Magnetic field"]
15116 pub xmag: f32,
15117 #[doc = "Y Magnetic field"]
15118 pub ymag: f32,
15119 #[doc = "Z Magnetic field"]
15120 pub zmag: f32,
15121 #[doc = "Absolute pressure"]
15122 pub abs_pressure: f32,
15123 #[doc = "Differential pressure"]
15124 pub diff_pressure: f32,
15125 #[doc = "Altitude calculated from pressure"]
15126 pub pressure_alt: f32,
15127 #[doc = "Temperature"]
15128 pub temperature: f32,
15129 #[doc = "Bitmap for fields that have updated since last message"]
15130 pub fields_updated: HighresImuUpdatedFlags,
15131 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
15132 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15133 pub id: u8,
15134}
15135impl HIGHRES_IMU_DATA {
15136 pub const ENCODED_LEN: usize = 63usize;
15137 pub const DEFAULT: Self = Self {
15138 time_usec: 0_u64,
15139 xacc: 0.0_f32,
15140 yacc: 0.0_f32,
15141 zacc: 0.0_f32,
15142 xgyro: 0.0_f32,
15143 ygyro: 0.0_f32,
15144 zgyro: 0.0_f32,
15145 xmag: 0.0_f32,
15146 ymag: 0.0_f32,
15147 zmag: 0.0_f32,
15148 abs_pressure: 0.0_f32,
15149 diff_pressure: 0.0_f32,
15150 pressure_alt: 0.0_f32,
15151 temperature: 0.0_f32,
15152 fields_updated: HighresImuUpdatedFlags::DEFAULT,
15153 id: 0_u8,
15154 };
15155 #[cfg(feature = "arbitrary")]
15156 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15157 use arbitrary::{Arbitrary, Unstructured};
15158 let mut buf = [0u8; 1024];
15159 rng.fill_bytes(&mut buf);
15160 let mut unstructured = Unstructured::new(&buf);
15161 Self::arbitrary(&mut unstructured).unwrap_or_default()
15162 }
15163}
15164impl Default for HIGHRES_IMU_DATA {
15165 fn default() -> Self {
15166 Self::DEFAULT.clone()
15167 }
15168}
15169impl MessageData for HIGHRES_IMU_DATA {
15170 type Message = MavMessage;
15171 const ID: u32 = 105u32;
15172 const NAME: &'static str = "HIGHRES_IMU";
15173 const EXTRA_CRC: u8 = 93u8;
15174 const ENCODED_LEN: usize = 63usize;
15175 fn deser(
15176 _version: MavlinkVersion,
15177 __input: &[u8],
15178 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15179 let avail_len = __input.len();
15180 let mut payload_buf = [0; Self::ENCODED_LEN];
15181 let mut buf = if avail_len < Self::ENCODED_LEN {
15182 payload_buf[0..avail_len].copy_from_slice(__input);
15183 Bytes::new(&payload_buf)
15184 } else {
15185 Bytes::new(__input)
15186 };
15187 let mut __struct = Self::default();
15188 __struct.time_usec = buf.get_u64_le();
15189 __struct.xacc = buf.get_f32_le();
15190 __struct.yacc = buf.get_f32_le();
15191 __struct.zacc = buf.get_f32_le();
15192 __struct.xgyro = buf.get_f32_le();
15193 __struct.ygyro = buf.get_f32_le();
15194 __struct.zgyro = buf.get_f32_le();
15195 __struct.xmag = buf.get_f32_le();
15196 __struct.ymag = buf.get_f32_le();
15197 __struct.zmag = buf.get_f32_le();
15198 __struct.abs_pressure = buf.get_f32_le();
15199 __struct.diff_pressure = buf.get_f32_le();
15200 __struct.pressure_alt = buf.get_f32_le();
15201 __struct.temperature = buf.get_f32_le();
15202 let tmp = buf.get_u16_le();
15203 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
15204 tmp & HighresImuUpdatedFlags::all().bits(),
15205 )
15206 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15207 flag_type: "HighresImuUpdatedFlags",
15208 value: tmp as u32,
15209 })?;
15210 __struct.id = buf.get_u8();
15211 Ok(__struct)
15212 }
15213 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15214 let mut __tmp = BytesMut::new(bytes);
15215 #[allow(clippy::absurd_extreme_comparisons)]
15216 #[allow(unused_comparisons)]
15217 if __tmp.remaining() < Self::ENCODED_LEN {
15218 panic!(
15219 "buffer is too small (need {} bytes, but got {})",
15220 Self::ENCODED_LEN,
15221 __tmp.remaining(),
15222 )
15223 }
15224 __tmp.put_u64_le(self.time_usec);
15225 __tmp.put_f32_le(self.xacc);
15226 __tmp.put_f32_le(self.yacc);
15227 __tmp.put_f32_le(self.zacc);
15228 __tmp.put_f32_le(self.xgyro);
15229 __tmp.put_f32_le(self.ygyro);
15230 __tmp.put_f32_le(self.zgyro);
15231 __tmp.put_f32_le(self.xmag);
15232 __tmp.put_f32_le(self.ymag);
15233 __tmp.put_f32_le(self.zmag);
15234 __tmp.put_f32_le(self.abs_pressure);
15235 __tmp.put_f32_le(self.diff_pressure);
15236 __tmp.put_f32_le(self.pressure_alt);
15237 __tmp.put_f32_le(self.temperature);
15238 __tmp.put_u16_le(self.fields_updated.bits());
15239 __tmp.put_u8(self.id);
15240 if matches!(version, MavlinkVersion::V2) {
15241 let len = __tmp.len();
15242 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15243 } else {
15244 __tmp.len()
15245 }
15246 }
15247}
15248#[doc = "id: 60051"]
15249#[doc = "Drone position."]
15250#[derive(Debug, Clone, PartialEq)]
15251#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15252#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15253pub struct AVSS_DRONE_POSITION_DATA {
15254 #[doc = "Timestamp (time since FC boot)."]
15255 pub time_boot_ms: u32,
15256 #[doc = "Latitude, expressed"]
15257 pub lat: i32,
15258 #[doc = "Longitude, expressed"]
15259 pub lon: i32,
15260 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
15261 pub alt: i32,
15262 #[doc = "Altitude above ground, This altitude is measured by a ultrasound, Laser rangefinder or millimeter-wave radar"]
15263 pub ground_alt: f32,
15264 #[doc = "This altitude is measured by a barometer"]
15265 pub barometer_alt: f32,
15266}
15267impl AVSS_DRONE_POSITION_DATA {
15268 pub const ENCODED_LEN: usize = 24usize;
15269 pub const DEFAULT: Self = Self {
15270 time_boot_ms: 0_u32,
15271 lat: 0_i32,
15272 lon: 0_i32,
15273 alt: 0_i32,
15274 ground_alt: 0.0_f32,
15275 barometer_alt: 0.0_f32,
15276 };
15277 #[cfg(feature = "arbitrary")]
15278 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15279 use arbitrary::{Arbitrary, Unstructured};
15280 let mut buf = [0u8; 1024];
15281 rng.fill_bytes(&mut buf);
15282 let mut unstructured = Unstructured::new(&buf);
15283 Self::arbitrary(&mut unstructured).unwrap_or_default()
15284 }
15285}
15286impl Default for AVSS_DRONE_POSITION_DATA {
15287 fn default() -> Self {
15288 Self::DEFAULT.clone()
15289 }
15290}
15291impl MessageData for AVSS_DRONE_POSITION_DATA {
15292 type Message = MavMessage;
15293 const ID: u32 = 60051u32;
15294 const NAME: &'static str = "AVSS_DRONE_POSITION";
15295 const EXTRA_CRC: u8 = 245u8;
15296 const ENCODED_LEN: usize = 24usize;
15297 fn deser(
15298 _version: MavlinkVersion,
15299 __input: &[u8],
15300 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15301 let avail_len = __input.len();
15302 let mut payload_buf = [0; Self::ENCODED_LEN];
15303 let mut buf = if avail_len < Self::ENCODED_LEN {
15304 payload_buf[0..avail_len].copy_from_slice(__input);
15305 Bytes::new(&payload_buf)
15306 } else {
15307 Bytes::new(__input)
15308 };
15309 let mut __struct = Self::default();
15310 __struct.time_boot_ms = buf.get_u32_le();
15311 __struct.lat = buf.get_i32_le();
15312 __struct.lon = buf.get_i32_le();
15313 __struct.alt = buf.get_i32_le();
15314 __struct.ground_alt = buf.get_f32_le();
15315 __struct.barometer_alt = buf.get_f32_le();
15316 Ok(__struct)
15317 }
15318 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15319 let mut __tmp = BytesMut::new(bytes);
15320 #[allow(clippy::absurd_extreme_comparisons)]
15321 #[allow(unused_comparisons)]
15322 if __tmp.remaining() < Self::ENCODED_LEN {
15323 panic!(
15324 "buffer is too small (need {} bytes, but got {})",
15325 Self::ENCODED_LEN,
15326 __tmp.remaining(),
15327 )
15328 }
15329 __tmp.put_u32_le(self.time_boot_ms);
15330 __tmp.put_i32_le(self.lat);
15331 __tmp.put_i32_le(self.lon);
15332 __tmp.put_i32_le(self.alt);
15333 __tmp.put_f32_le(self.ground_alt);
15334 __tmp.put_f32_le(self.barometer_alt);
15335 if matches!(version, MavlinkVersion::V2) {
15336 let len = __tmp.len();
15337 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15338 } else {
15339 __tmp.len()
15340 }
15341 }
15342}
15343#[doc = "id: 38"]
15344#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
15345#[derive(Debug, Clone, PartialEq)]
15346#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15347#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15348pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
15349 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
15350 pub start_index: i16,
15351 #[doc = "End index, equal or greater than start index."]
15352 pub end_index: i16,
15353 #[doc = "System ID"]
15354 pub target_system: u8,
15355 #[doc = "Component ID"]
15356 pub target_component: u8,
15357 #[doc = "Mission type."]
15358 #[cfg_attr(feature = "serde", serde(default))]
15359 pub mission_type: MavMissionType,
15360}
15361impl MISSION_WRITE_PARTIAL_LIST_DATA {
15362 pub const ENCODED_LEN: usize = 7usize;
15363 pub const DEFAULT: Self = Self {
15364 start_index: 0_i16,
15365 end_index: 0_i16,
15366 target_system: 0_u8,
15367 target_component: 0_u8,
15368 mission_type: MavMissionType::DEFAULT,
15369 };
15370 #[cfg(feature = "arbitrary")]
15371 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15372 use arbitrary::{Arbitrary, Unstructured};
15373 let mut buf = [0u8; 1024];
15374 rng.fill_bytes(&mut buf);
15375 let mut unstructured = Unstructured::new(&buf);
15376 Self::arbitrary(&mut unstructured).unwrap_or_default()
15377 }
15378}
15379impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
15380 fn default() -> Self {
15381 Self::DEFAULT.clone()
15382 }
15383}
15384impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
15385 type Message = MavMessage;
15386 const ID: u32 = 38u32;
15387 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
15388 const EXTRA_CRC: u8 = 9u8;
15389 const ENCODED_LEN: usize = 7usize;
15390 fn deser(
15391 _version: MavlinkVersion,
15392 __input: &[u8],
15393 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15394 let avail_len = __input.len();
15395 let mut payload_buf = [0; Self::ENCODED_LEN];
15396 let mut buf = if avail_len < Self::ENCODED_LEN {
15397 payload_buf[0..avail_len].copy_from_slice(__input);
15398 Bytes::new(&payload_buf)
15399 } else {
15400 Bytes::new(__input)
15401 };
15402 let mut __struct = Self::default();
15403 __struct.start_index = buf.get_i16_le();
15404 __struct.end_index = buf.get_i16_le();
15405 __struct.target_system = buf.get_u8();
15406 __struct.target_component = buf.get_u8();
15407 let tmp = buf.get_u8();
15408 __struct.mission_type =
15409 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15410 enum_type: "MavMissionType",
15411 value: tmp as u32,
15412 })?;
15413 Ok(__struct)
15414 }
15415 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15416 let mut __tmp = BytesMut::new(bytes);
15417 #[allow(clippy::absurd_extreme_comparisons)]
15418 #[allow(unused_comparisons)]
15419 if __tmp.remaining() < Self::ENCODED_LEN {
15420 panic!(
15421 "buffer is too small (need {} bytes, but got {})",
15422 Self::ENCODED_LEN,
15423 __tmp.remaining(),
15424 )
15425 }
15426 __tmp.put_i16_le(self.start_index);
15427 __tmp.put_i16_le(self.end_index);
15428 __tmp.put_u8(self.target_system);
15429 __tmp.put_u8(self.target_component);
15430 __tmp.put_u8(self.mission_type as u8);
15431 if matches!(version, MavlinkVersion::V2) {
15432 let len = __tmp.len();
15433 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15434 } else {
15435 __tmp.len()
15436 }
15437 }
15438}
15439#[doc = "id: 261"]
15440#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
15441#[derive(Debug, Clone, PartialEq)]
15442#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15443#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15444pub struct STORAGE_INFORMATION_DATA {
15445 #[doc = "Timestamp (time since system boot)."]
15446 pub time_boot_ms: u32,
15447 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
15448 pub total_capacity: f32,
15449 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
15450 pub used_capacity: f32,
15451 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
15452 pub available_capacity: f32,
15453 #[doc = "Read speed."]
15454 pub read_speed: f32,
15455 #[doc = "Write speed."]
15456 pub write_speed: f32,
15457 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
15458 pub storage_id: u8,
15459 #[doc = "Number of storage devices"]
15460 pub storage_count: u8,
15461 #[doc = "Status of storage"]
15462 pub status: StorageStatus,
15463 #[doc = "Type of storage"]
15464 #[cfg_attr(feature = "serde", serde(default))]
15465 pub mavtype: StorageType,
15466 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
15467 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15468 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15469 pub name: [u8; 32],
15470 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
15471 #[cfg_attr(feature = "serde", serde(default))]
15472 pub storage_usage: StorageUsageFlag,
15473}
15474impl STORAGE_INFORMATION_DATA {
15475 pub const ENCODED_LEN: usize = 61usize;
15476 pub const DEFAULT: Self = Self {
15477 time_boot_ms: 0_u32,
15478 total_capacity: 0.0_f32,
15479 used_capacity: 0.0_f32,
15480 available_capacity: 0.0_f32,
15481 read_speed: 0.0_f32,
15482 write_speed: 0.0_f32,
15483 storage_id: 0_u8,
15484 storage_count: 0_u8,
15485 status: StorageStatus::DEFAULT,
15486 mavtype: StorageType::DEFAULT,
15487 name: [0_u8; 32usize],
15488 storage_usage: StorageUsageFlag::DEFAULT,
15489 };
15490 #[cfg(feature = "arbitrary")]
15491 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15492 use arbitrary::{Arbitrary, Unstructured};
15493 let mut buf = [0u8; 1024];
15494 rng.fill_bytes(&mut buf);
15495 let mut unstructured = Unstructured::new(&buf);
15496 Self::arbitrary(&mut unstructured).unwrap_or_default()
15497 }
15498}
15499impl Default for STORAGE_INFORMATION_DATA {
15500 fn default() -> Self {
15501 Self::DEFAULT.clone()
15502 }
15503}
15504impl MessageData for STORAGE_INFORMATION_DATA {
15505 type Message = MavMessage;
15506 const ID: u32 = 261u32;
15507 const NAME: &'static str = "STORAGE_INFORMATION";
15508 const EXTRA_CRC: u8 = 179u8;
15509 const ENCODED_LEN: usize = 61usize;
15510 fn deser(
15511 _version: MavlinkVersion,
15512 __input: &[u8],
15513 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15514 let avail_len = __input.len();
15515 let mut payload_buf = [0; Self::ENCODED_LEN];
15516 let mut buf = if avail_len < Self::ENCODED_LEN {
15517 payload_buf[0..avail_len].copy_from_slice(__input);
15518 Bytes::new(&payload_buf)
15519 } else {
15520 Bytes::new(__input)
15521 };
15522 let mut __struct = Self::default();
15523 __struct.time_boot_ms = buf.get_u32_le();
15524 __struct.total_capacity = buf.get_f32_le();
15525 __struct.used_capacity = buf.get_f32_le();
15526 __struct.available_capacity = buf.get_f32_le();
15527 __struct.read_speed = buf.get_f32_le();
15528 __struct.write_speed = buf.get_f32_le();
15529 __struct.storage_id = buf.get_u8();
15530 __struct.storage_count = buf.get_u8();
15531 let tmp = buf.get_u8();
15532 __struct.status =
15533 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15534 enum_type: "StorageStatus",
15535 value: tmp as u32,
15536 })?;
15537 let tmp = buf.get_u8();
15538 __struct.mavtype =
15539 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15540 enum_type: "StorageType",
15541 value: tmp as u32,
15542 })?;
15543 for v in &mut __struct.name {
15544 let val = buf.get_u8();
15545 *v = val;
15546 }
15547 let tmp = buf.get_u8();
15548 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
15549 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15550 flag_type: "StorageUsageFlag",
15551 value: tmp as u32,
15552 })?;
15553 Ok(__struct)
15554 }
15555 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15556 let mut __tmp = BytesMut::new(bytes);
15557 #[allow(clippy::absurd_extreme_comparisons)]
15558 #[allow(unused_comparisons)]
15559 if __tmp.remaining() < Self::ENCODED_LEN {
15560 panic!(
15561 "buffer is too small (need {} bytes, but got {})",
15562 Self::ENCODED_LEN,
15563 __tmp.remaining(),
15564 )
15565 }
15566 __tmp.put_u32_le(self.time_boot_ms);
15567 __tmp.put_f32_le(self.total_capacity);
15568 __tmp.put_f32_le(self.used_capacity);
15569 __tmp.put_f32_le(self.available_capacity);
15570 __tmp.put_f32_le(self.read_speed);
15571 __tmp.put_f32_le(self.write_speed);
15572 __tmp.put_u8(self.storage_id);
15573 __tmp.put_u8(self.storage_count);
15574 __tmp.put_u8(self.status as u8);
15575 __tmp.put_u8(self.mavtype as u8);
15576 for val in &self.name {
15577 __tmp.put_u8(*val);
15578 }
15579 __tmp.put_u8(self.storage_usage.bits());
15580 if matches!(version, MavlinkVersion::V2) {
15581 let len = __tmp.len();
15582 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15583 } else {
15584 __tmp.len()
15585 }
15586 }
15587}
15588#[doc = "id: 248"]
15589#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
15590#[derive(Debug, Clone, PartialEq)]
15591#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15592#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15593pub struct V2_EXTENSION_DATA {
15594 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
15595 pub message_type: u16,
15596 #[doc = "Network ID (0 for broadcast)"]
15597 pub target_network: u8,
15598 #[doc = "System ID (0 for broadcast)"]
15599 pub target_system: u8,
15600 #[doc = "Component ID (0 for broadcast)"]
15601 pub target_component: u8,
15602 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
15603 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15604 pub payload: [u8; 249],
15605}
15606impl V2_EXTENSION_DATA {
15607 pub const ENCODED_LEN: usize = 254usize;
15608 pub const DEFAULT: Self = Self {
15609 message_type: 0_u16,
15610 target_network: 0_u8,
15611 target_system: 0_u8,
15612 target_component: 0_u8,
15613 payload: [0_u8; 249usize],
15614 };
15615 #[cfg(feature = "arbitrary")]
15616 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15617 use arbitrary::{Arbitrary, Unstructured};
15618 let mut buf = [0u8; 1024];
15619 rng.fill_bytes(&mut buf);
15620 let mut unstructured = Unstructured::new(&buf);
15621 Self::arbitrary(&mut unstructured).unwrap_or_default()
15622 }
15623}
15624impl Default for V2_EXTENSION_DATA {
15625 fn default() -> Self {
15626 Self::DEFAULT.clone()
15627 }
15628}
15629impl MessageData for V2_EXTENSION_DATA {
15630 type Message = MavMessage;
15631 const ID: u32 = 248u32;
15632 const NAME: &'static str = "V2_EXTENSION";
15633 const EXTRA_CRC: u8 = 8u8;
15634 const ENCODED_LEN: usize = 254usize;
15635 fn deser(
15636 _version: MavlinkVersion,
15637 __input: &[u8],
15638 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15639 let avail_len = __input.len();
15640 let mut payload_buf = [0; Self::ENCODED_LEN];
15641 let mut buf = if avail_len < Self::ENCODED_LEN {
15642 payload_buf[0..avail_len].copy_from_slice(__input);
15643 Bytes::new(&payload_buf)
15644 } else {
15645 Bytes::new(__input)
15646 };
15647 let mut __struct = Self::default();
15648 __struct.message_type = buf.get_u16_le();
15649 __struct.target_network = buf.get_u8();
15650 __struct.target_system = buf.get_u8();
15651 __struct.target_component = buf.get_u8();
15652 for v in &mut __struct.payload {
15653 let val = buf.get_u8();
15654 *v = val;
15655 }
15656 Ok(__struct)
15657 }
15658 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15659 let mut __tmp = BytesMut::new(bytes);
15660 #[allow(clippy::absurd_extreme_comparisons)]
15661 #[allow(unused_comparisons)]
15662 if __tmp.remaining() < Self::ENCODED_LEN {
15663 panic!(
15664 "buffer is too small (need {} bytes, but got {})",
15665 Self::ENCODED_LEN,
15666 __tmp.remaining(),
15667 )
15668 }
15669 __tmp.put_u16_le(self.message_type);
15670 __tmp.put_u8(self.target_network);
15671 __tmp.put_u8(self.target_system);
15672 __tmp.put_u8(self.target_component);
15673 for val in &self.payload {
15674 __tmp.put_u8(*val);
15675 }
15676 if matches!(version, MavlinkVersion::V2) {
15677 let len = __tmp.len();
15678 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15679 } else {
15680 __tmp.len()
15681 }
15682 }
15683}
15684#[doc = "id: 69"]
15685#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
15686#[derive(Debug, Clone, PartialEq)]
15687#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15688#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15689pub struct MANUAL_CONTROL_DATA {
15690 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
15691 pub x: i16,
15692 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
15693 pub y: i16,
15694 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
15695 pub z: i16,
15696 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
15697 pub r: i16,
15698 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
15699 pub buttons: u16,
15700 #[doc = "The system to be controlled."]
15701 pub target: u8,
15702 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
15703 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15704 pub buttons2: u16,
15705 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
15706 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15707 pub enabled_extensions: u8,
15708 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
15709 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15710 pub s: i16,
15711 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
15712 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15713 pub t: i16,
15714 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
15715 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15716 pub aux1: i16,
15717 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
15718 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15719 pub aux2: i16,
15720 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
15721 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15722 pub aux3: i16,
15723 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
15724 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15725 pub aux4: i16,
15726 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
15727 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15728 pub aux5: i16,
15729 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
15730 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15731 pub aux6: i16,
15732}
15733impl MANUAL_CONTROL_DATA {
15734 pub const ENCODED_LEN: usize = 30usize;
15735 pub const DEFAULT: Self = Self {
15736 x: 0_i16,
15737 y: 0_i16,
15738 z: 0_i16,
15739 r: 0_i16,
15740 buttons: 0_u16,
15741 target: 0_u8,
15742 buttons2: 0_u16,
15743 enabled_extensions: 0_u8,
15744 s: 0_i16,
15745 t: 0_i16,
15746 aux1: 0_i16,
15747 aux2: 0_i16,
15748 aux3: 0_i16,
15749 aux4: 0_i16,
15750 aux5: 0_i16,
15751 aux6: 0_i16,
15752 };
15753 #[cfg(feature = "arbitrary")]
15754 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15755 use arbitrary::{Arbitrary, Unstructured};
15756 let mut buf = [0u8; 1024];
15757 rng.fill_bytes(&mut buf);
15758 let mut unstructured = Unstructured::new(&buf);
15759 Self::arbitrary(&mut unstructured).unwrap_or_default()
15760 }
15761}
15762impl Default for MANUAL_CONTROL_DATA {
15763 fn default() -> Self {
15764 Self::DEFAULT.clone()
15765 }
15766}
15767impl MessageData for MANUAL_CONTROL_DATA {
15768 type Message = MavMessage;
15769 const ID: u32 = 69u32;
15770 const NAME: &'static str = "MANUAL_CONTROL";
15771 const EXTRA_CRC: u8 = 243u8;
15772 const ENCODED_LEN: usize = 30usize;
15773 fn deser(
15774 _version: MavlinkVersion,
15775 __input: &[u8],
15776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15777 let avail_len = __input.len();
15778 let mut payload_buf = [0; Self::ENCODED_LEN];
15779 let mut buf = if avail_len < Self::ENCODED_LEN {
15780 payload_buf[0..avail_len].copy_from_slice(__input);
15781 Bytes::new(&payload_buf)
15782 } else {
15783 Bytes::new(__input)
15784 };
15785 let mut __struct = Self::default();
15786 __struct.x = buf.get_i16_le();
15787 __struct.y = buf.get_i16_le();
15788 __struct.z = buf.get_i16_le();
15789 __struct.r = buf.get_i16_le();
15790 __struct.buttons = buf.get_u16_le();
15791 __struct.target = buf.get_u8();
15792 __struct.buttons2 = buf.get_u16_le();
15793 __struct.enabled_extensions = buf.get_u8();
15794 __struct.s = buf.get_i16_le();
15795 __struct.t = buf.get_i16_le();
15796 __struct.aux1 = buf.get_i16_le();
15797 __struct.aux2 = buf.get_i16_le();
15798 __struct.aux3 = buf.get_i16_le();
15799 __struct.aux4 = buf.get_i16_le();
15800 __struct.aux5 = buf.get_i16_le();
15801 __struct.aux6 = buf.get_i16_le();
15802 Ok(__struct)
15803 }
15804 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15805 let mut __tmp = BytesMut::new(bytes);
15806 #[allow(clippy::absurd_extreme_comparisons)]
15807 #[allow(unused_comparisons)]
15808 if __tmp.remaining() < Self::ENCODED_LEN {
15809 panic!(
15810 "buffer is too small (need {} bytes, but got {})",
15811 Self::ENCODED_LEN,
15812 __tmp.remaining(),
15813 )
15814 }
15815 __tmp.put_i16_le(self.x);
15816 __tmp.put_i16_le(self.y);
15817 __tmp.put_i16_le(self.z);
15818 __tmp.put_i16_le(self.r);
15819 __tmp.put_u16_le(self.buttons);
15820 __tmp.put_u8(self.target);
15821 __tmp.put_u16_le(self.buttons2);
15822 __tmp.put_u8(self.enabled_extensions);
15823 __tmp.put_i16_le(self.s);
15824 __tmp.put_i16_le(self.t);
15825 __tmp.put_i16_le(self.aux1);
15826 __tmp.put_i16_le(self.aux2);
15827 __tmp.put_i16_le(self.aux3);
15828 __tmp.put_i16_le(self.aux4);
15829 __tmp.put_i16_le(self.aux5);
15830 __tmp.put_i16_le(self.aux6);
15831 if matches!(version, MavlinkVersion::V2) {
15832 let len = __tmp.len();
15833 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15834 } else {
15835 __tmp.len()
15836 }
15837 }
15838}
15839#[doc = "id: 230"]
15840#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
15841#[derive(Debug, Clone, PartialEq)]
15842#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15843#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15844pub struct ESTIMATOR_STATUS_DATA {
15845 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15846 pub time_usec: u64,
15847 #[doc = "Velocity innovation test ratio"]
15848 pub vel_ratio: f32,
15849 #[doc = "Horizontal position innovation test ratio"]
15850 pub pos_horiz_ratio: f32,
15851 #[doc = "Vertical position innovation test ratio"]
15852 pub pos_vert_ratio: f32,
15853 #[doc = "Magnetometer innovation test ratio"]
15854 pub mag_ratio: f32,
15855 #[doc = "Height above terrain innovation test ratio"]
15856 pub hagl_ratio: f32,
15857 #[doc = "True airspeed innovation test ratio"]
15858 pub tas_ratio: f32,
15859 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
15860 pub pos_horiz_accuracy: f32,
15861 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
15862 pub pos_vert_accuracy: f32,
15863 #[doc = "Bitmap indicating which EKF outputs are valid."]
15864 pub flags: EstimatorStatusFlags,
15865}
15866impl ESTIMATOR_STATUS_DATA {
15867 pub const ENCODED_LEN: usize = 42usize;
15868 pub const DEFAULT: Self = Self {
15869 time_usec: 0_u64,
15870 vel_ratio: 0.0_f32,
15871 pos_horiz_ratio: 0.0_f32,
15872 pos_vert_ratio: 0.0_f32,
15873 mag_ratio: 0.0_f32,
15874 hagl_ratio: 0.0_f32,
15875 tas_ratio: 0.0_f32,
15876 pos_horiz_accuracy: 0.0_f32,
15877 pos_vert_accuracy: 0.0_f32,
15878 flags: EstimatorStatusFlags::DEFAULT,
15879 };
15880 #[cfg(feature = "arbitrary")]
15881 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15882 use arbitrary::{Arbitrary, Unstructured};
15883 let mut buf = [0u8; 1024];
15884 rng.fill_bytes(&mut buf);
15885 let mut unstructured = Unstructured::new(&buf);
15886 Self::arbitrary(&mut unstructured).unwrap_or_default()
15887 }
15888}
15889impl Default for ESTIMATOR_STATUS_DATA {
15890 fn default() -> Self {
15891 Self::DEFAULT.clone()
15892 }
15893}
15894impl MessageData for ESTIMATOR_STATUS_DATA {
15895 type Message = MavMessage;
15896 const ID: u32 = 230u32;
15897 const NAME: &'static str = "ESTIMATOR_STATUS";
15898 const EXTRA_CRC: u8 = 163u8;
15899 const ENCODED_LEN: usize = 42usize;
15900 fn deser(
15901 _version: MavlinkVersion,
15902 __input: &[u8],
15903 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15904 let avail_len = __input.len();
15905 let mut payload_buf = [0; Self::ENCODED_LEN];
15906 let mut buf = if avail_len < Self::ENCODED_LEN {
15907 payload_buf[0..avail_len].copy_from_slice(__input);
15908 Bytes::new(&payload_buf)
15909 } else {
15910 Bytes::new(__input)
15911 };
15912 let mut __struct = Self::default();
15913 __struct.time_usec = buf.get_u64_le();
15914 __struct.vel_ratio = buf.get_f32_le();
15915 __struct.pos_horiz_ratio = buf.get_f32_le();
15916 __struct.pos_vert_ratio = buf.get_f32_le();
15917 __struct.mag_ratio = buf.get_f32_le();
15918 __struct.hagl_ratio = buf.get_f32_le();
15919 __struct.tas_ratio = buf.get_f32_le();
15920 __struct.pos_horiz_accuracy = buf.get_f32_le();
15921 __struct.pos_vert_accuracy = buf.get_f32_le();
15922 let tmp = buf.get_u16_le();
15923 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
15924 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15925 flag_type: "EstimatorStatusFlags",
15926 value: tmp as u32,
15927 })?;
15928 Ok(__struct)
15929 }
15930 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15931 let mut __tmp = BytesMut::new(bytes);
15932 #[allow(clippy::absurd_extreme_comparisons)]
15933 #[allow(unused_comparisons)]
15934 if __tmp.remaining() < Self::ENCODED_LEN {
15935 panic!(
15936 "buffer is too small (need {} bytes, but got {})",
15937 Self::ENCODED_LEN,
15938 __tmp.remaining(),
15939 )
15940 }
15941 __tmp.put_u64_le(self.time_usec);
15942 __tmp.put_f32_le(self.vel_ratio);
15943 __tmp.put_f32_le(self.pos_horiz_ratio);
15944 __tmp.put_f32_le(self.pos_vert_ratio);
15945 __tmp.put_f32_le(self.mag_ratio);
15946 __tmp.put_f32_le(self.hagl_ratio);
15947 __tmp.put_f32_le(self.tas_ratio);
15948 __tmp.put_f32_le(self.pos_horiz_accuracy);
15949 __tmp.put_f32_le(self.pos_vert_accuracy);
15950 __tmp.put_u16_le(self.flags.bits());
15951 if matches!(version, MavlinkVersion::V2) {
15952 let len = __tmp.len();
15953 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15954 } else {
15955 __tmp.len()
15956 }
15957 }
15958}
15959#[doc = "id: 242"]
15960#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
15961#[derive(Debug, Clone, PartialEq)]
15962#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15963#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15964pub struct HOME_POSITION_DATA {
15965 #[doc = "Latitude (WGS84)"]
15966 pub latitude: i32,
15967 #[doc = "Longitude (WGS84)"]
15968 pub longitude: i32,
15969 #[doc = "Altitude (MSL). Positive for up."]
15970 pub altitude: i32,
15971 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
15972 pub x: f32,
15973 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
15974 pub y: f32,
15975 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
15976 pub z: f32,
15977 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
15978 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15979 pub q: [f32; 4],
15980 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
15981 pub approach_x: f32,
15982 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
15983 pub approach_y: f32,
15984 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
15985 pub approach_z: f32,
15986 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15987 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15988 pub time_usec: u64,
15989}
15990impl HOME_POSITION_DATA {
15991 pub const ENCODED_LEN: usize = 60usize;
15992 pub const DEFAULT: Self = Self {
15993 latitude: 0_i32,
15994 longitude: 0_i32,
15995 altitude: 0_i32,
15996 x: 0.0_f32,
15997 y: 0.0_f32,
15998 z: 0.0_f32,
15999 q: [0.0_f32; 4usize],
16000 approach_x: 0.0_f32,
16001 approach_y: 0.0_f32,
16002 approach_z: 0.0_f32,
16003 time_usec: 0_u64,
16004 };
16005 #[cfg(feature = "arbitrary")]
16006 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16007 use arbitrary::{Arbitrary, Unstructured};
16008 let mut buf = [0u8; 1024];
16009 rng.fill_bytes(&mut buf);
16010 let mut unstructured = Unstructured::new(&buf);
16011 Self::arbitrary(&mut unstructured).unwrap_or_default()
16012 }
16013}
16014impl Default for HOME_POSITION_DATA {
16015 fn default() -> Self {
16016 Self::DEFAULT.clone()
16017 }
16018}
16019impl MessageData for HOME_POSITION_DATA {
16020 type Message = MavMessage;
16021 const ID: u32 = 242u32;
16022 const NAME: &'static str = "HOME_POSITION";
16023 const EXTRA_CRC: u8 = 104u8;
16024 const ENCODED_LEN: usize = 60usize;
16025 fn deser(
16026 _version: MavlinkVersion,
16027 __input: &[u8],
16028 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16029 let avail_len = __input.len();
16030 let mut payload_buf = [0; Self::ENCODED_LEN];
16031 let mut buf = if avail_len < Self::ENCODED_LEN {
16032 payload_buf[0..avail_len].copy_from_slice(__input);
16033 Bytes::new(&payload_buf)
16034 } else {
16035 Bytes::new(__input)
16036 };
16037 let mut __struct = Self::default();
16038 __struct.latitude = buf.get_i32_le();
16039 __struct.longitude = buf.get_i32_le();
16040 __struct.altitude = buf.get_i32_le();
16041 __struct.x = buf.get_f32_le();
16042 __struct.y = buf.get_f32_le();
16043 __struct.z = buf.get_f32_le();
16044 for v in &mut __struct.q {
16045 let val = buf.get_f32_le();
16046 *v = val;
16047 }
16048 __struct.approach_x = buf.get_f32_le();
16049 __struct.approach_y = buf.get_f32_le();
16050 __struct.approach_z = buf.get_f32_le();
16051 __struct.time_usec = buf.get_u64_le();
16052 Ok(__struct)
16053 }
16054 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16055 let mut __tmp = BytesMut::new(bytes);
16056 #[allow(clippy::absurd_extreme_comparisons)]
16057 #[allow(unused_comparisons)]
16058 if __tmp.remaining() < Self::ENCODED_LEN {
16059 panic!(
16060 "buffer is too small (need {} bytes, but got {})",
16061 Self::ENCODED_LEN,
16062 __tmp.remaining(),
16063 )
16064 }
16065 __tmp.put_i32_le(self.latitude);
16066 __tmp.put_i32_le(self.longitude);
16067 __tmp.put_i32_le(self.altitude);
16068 __tmp.put_f32_le(self.x);
16069 __tmp.put_f32_le(self.y);
16070 __tmp.put_f32_le(self.z);
16071 for val in &self.q {
16072 __tmp.put_f32_le(*val);
16073 }
16074 __tmp.put_f32_le(self.approach_x);
16075 __tmp.put_f32_le(self.approach_y);
16076 __tmp.put_f32_le(self.approach_z);
16077 __tmp.put_u64_le(self.time_usec);
16078 if matches!(version, MavlinkVersion::V2) {
16079 let len = __tmp.len();
16080 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16081 } else {
16082 __tmp.len()
16083 }
16084 }
16085}
16086#[doc = "id: 370"]
16087#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
16088#[derive(Debug, Clone, PartialEq)]
16089#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16090#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16091pub struct SMART_BATTERY_INFO_DATA {
16092 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
16093 pub capacity_full_specification: i32,
16094 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
16095 pub capacity_full: i32,
16096 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
16097 pub cycle_count: u16,
16098 #[doc = "Battery weight. 0: field not provided."]
16099 pub weight: u16,
16100 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
16101 pub discharge_minimum_voltage: u16,
16102 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
16103 pub charging_minimum_voltage: u16,
16104 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
16105 pub resting_minimum_voltage: u16,
16106 #[doc = "Battery ID"]
16107 pub id: u8,
16108 #[doc = "Function of the battery"]
16109 pub battery_function: MavBatteryFunction,
16110 #[doc = "Type (chemistry) of the battery"]
16111 pub mavtype: MavBatteryType,
16112 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
16113 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16114 pub serial_number: [u8; 16],
16115 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
16116 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16117 pub device_name: [u8; 50],
16118 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
16119 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16120 pub charging_maximum_voltage: u16,
16121 #[doc = "Number of battery cells in series. 0: field not provided."]
16122 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16123 pub cells_in_series: u8,
16124 #[doc = "Maximum pack discharge current. 0: field not provided."]
16125 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16126 pub discharge_maximum_current: u32,
16127 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
16128 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16129 pub discharge_maximum_burst_current: u32,
16130 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
16131 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16132 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16133 pub manufacture_date: [u8; 11],
16134}
16135impl SMART_BATTERY_INFO_DATA {
16136 pub const ENCODED_LEN: usize = 109usize;
16137 pub const DEFAULT: Self = Self {
16138 capacity_full_specification: 0_i32,
16139 capacity_full: 0_i32,
16140 cycle_count: 0_u16,
16141 weight: 0_u16,
16142 discharge_minimum_voltage: 0_u16,
16143 charging_minimum_voltage: 0_u16,
16144 resting_minimum_voltage: 0_u16,
16145 id: 0_u8,
16146 battery_function: MavBatteryFunction::DEFAULT,
16147 mavtype: MavBatteryType::DEFAULT,
16148 serial_number: [0_u8; 16usize],
16149 device_name: [0_u8; 50usize],
16150 charging_maximum_voltage: 0_u16,
16151 cells_in_series: 0_u8,
16152 discharge_maximum_current: 0_u32,
16153 discharge_maximum_burst_current: 0_u32,
16154 manufacture_date: [0_u8; 11usize],
16155 };
16156 #[cfg(feature = "arbitrary")]
16157 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16158 use arbitrary::{Arbitrary, Unstructured};
16159 let mut buf = [0u8; 1024];
16160 rng.fill_bytes(&mut buf);
16161 let mut unstructured = Unstructured::new(&buf);
16162 Self::arbitrary(&mut unstructured).unwrap_or_default()
16163 }
16164}
16165impl Default for SMART_BATTERY_INFO_DATA {
16166 fn default() -> Self {
16167 Self::DEFAULT.clone()
16168 }
16169}
16170impl MessageData for SMART_BATTERY_INFO_DATA {
16171 type Message = MavMessage;
16172 const ID: u32 = 370u32;
16173 const NAME: &'static str = "SMART_BATTERY_INFO";
16174 const EXTRA_CRC: u8 = 75u8;
16175 const ENCODED_LEN: usize = 109usize;
16176 fn deser(
16177 _version: MavlinkVersion,
16178 __input: &[u8],
16179 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16180 let avail_len = __input.len();
16181 let mut payload_buf = [0; Self::ENCODED_LEN];
16182 let mut buf = if avail_len < Self::ENCODED_LEN {
16183 payload_buf[0..avail_len].copy_from_slice(__input);
16184 Bytes::new(&payload_buf)
16185 } else {
16186 Bytes::new(__input)
16187 };
16188 let mut __struct = Self::default();
16189 __struct.capacity_full_specification = buf.get_i32_le();
16190 __struct.capacity_full = buf.get_i32_le();
16191 __struct.cycle_count = buf.get_u16_le();
16192 __struct.weight = buf.get_u16_le();
16193 __struct.discharge_minimum_voltage = buf.get_u16_le();
16194 __struct.charging_minimum_voltage = buf.get_u16_le();
16195 __struct.resting_minimum_voltage = buf.get_u16_le();
16196 __struct.id = buf.get_u8();
16197 let tmp = buf.get_u8();
16198 __struct.battery_function =
16199 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16200 enum_type: "MavBatteryFunction",
16201 value: tmp as u32,
16202 })?;
16203 let tmp = buf.get_u8();
16204 __struct.mavtype =
16205 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16206 enum_type: "MavBatteryType",
16207 value: tmp as u32,
16208 })?;
16209 for v in &mut __struct.serial_number {
16210 let val = buf.get_u8();
16211 *v = val;
16212 }
16213 for v in &mut __struct.device_name {
16214 let val = buf.get_u8();
16215 *v = val;
16216 }
16217 __struct.charging_maximum_voltage = buf.get_u16_le();
16218 __struct.cells_in_series = buf.get_u8();
16219 __struct.discharge_maximum_current = buf.get_u32_le();
16220 __struct.discharge_maximum_burst_current = buf.get_u32_le();
16221 for v in &mut __struct.manufacture_date {
16222 let val = buf.get_u8();
16223 *v = val;
16224 }
16225 Ok(__struct)
16226 }
16227 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16228 let mut __tmp = BytesMut::new(bytes);
16229 #[allow(clippy::absurd_extreme_comparisons)]
16230 #[allow(unused_comparisons)]
16231 if __tmp.remaining() < Self::ENCODED_LEN {
16232 panic!(
16233 "buffer is too small (need {} bytes, but got {})",
16234 Self::ENCODED_LEN,
16235 __tmp.remaining(),
16236 )
16237 }
16238 __tmp.put_i32_le(self.capacity_full_specification);
16239 __tmp.put_i32_le(self.capacity_full);
16240 __tmp.put_u16_le(self.cycle_count);
16241 __tmp.put_u16_le(self.weight);
16242 __tmp.put_u16_le(self.discharge_minimum_voltage);
16243 __tmp.put_u16_le(self.charging_minimum_voltage);
16244 __tmp.put_u16_le(self.resting_minimum_voltage);
16245 __tmp.put_u8(self.id);
16246 __tmp.put_u8(self.battery_function as u8);
16247 __tmp.put_u8(self.mavtype as u8);
16248 for val in &self.serial_number {
16249 __tmp.put_u8(*val);
16250 }
16251 for val in &self.device_name {
16252 __tmp.put_u8(*val);
16253 }
16254 __tmp.put_u16_le(self.charging_maximum_voltage);
16255 __tmp.put_u8(self.cells_in_series);
16256 __tmp.put_u32_le(self.discharge_maximum_current);
16257 __tmp.put_u32_le(self.discharge_maximum_burst_current);
16258 for val in &self.manufacture_date {
16259 __tmp.put_u8(*val);
16260 }
16261 if matches!(version, MavlinkVersion::V2) {
16262 let len = __tmp.len();
16263 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16264 } else {
16265 __tmp.len()
16266 }
16267 }
16268}
16269#[doc = "id: 91"]
16270#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
16271#[derive(Debug, Clone, PartialEq)]
16272#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16273#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16274pub struct HIL_CONTROLS_DATA {
16275 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16276 pub time_usec: u64,
16277 #[doc = "Control output -1 .. 1"]
16278 pub roll_ailerons: f32,
16279 #[doc = "Control output -1 .. 1"]
16280 pub pitch_elevator: f32,
16281 #[doc = "Control output -1 .. 1"]
16282 pub yaw_rudder: f32,
16283 #[doc = "Throttle 0 .. 1"]
16284 pub throttle: f32,
16285 #[doc = "Aux 1, -1 .. 1"]
16286 pub aux1: f32,
16287 #[doc = "Aux 2, -1 .. 1"]
16288 pub aux2: f32,
16289 #[doc = "Aux 3, -1 .. 1"]
16290 pub aux3: f32,
16291 #[doc = "Aux 4, -1 .. 1"]
16292 pub aux4: f32,
16293 #[doc = "System mode."]
16294 pub mode: MavMode,
16295 #[doc = "Navigation mode (MAV_NAV_MODE)"]
16296 pub nav_mode: u8,
16297}
16298impl HIL_CONTROLS_DATA {
16299 pub const ENCODED_LEN: usize = 42usize;
16300 pub const DEFAULT: Self = Self {
16301 time_usec: 0_u64,
16302 roll_ailerons: 0.0_f32,
16303 pitch_elevator: 0.0_f32,
16304 yaw_rudder: 0.0_f32,
16305 throttle: 0.0_f32,
16306 aux1: 0.0_f32,
16307 aux2: 0.0_f32,
16308 aux3: 0.0_f32,
16309 aux4: 0.0_f32,
16310 mode: MavMode::DEFAULT,
16311 nav_mode: 0_u8,
16312 };
16313 #[cfg(feature = "arbitrary")]
16314 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16315 use arbitrary::{Arbitrary, Unstructured};
16316 let mut buf = [0u8; 1024];
16317 rng.fill_bytes(&mut buf);
16318 let mut unstructured = Unstructured::new(&buf);
16319 Self::arbitrary(&mut unstructured).unwrap_or_default()
16320 }
16321}
16322impl Default for HIL_CONTROLS_DATA {
16323 fn default() -> Self {
16324 Self::DEFAULT.clone()
16325 }
16326}
16327impl MessageData for HIL_CONTROLS_DATA {
16328 type Message = MavMessage;
16329 const ID: u32 = 91u32;
16330 const NAME: &'static str = "HIL_CONTROLS";
16331 const EXTRA_CRC: u8 = 63u8;
16332 const ENCODED_LEN: usize = 42usize;
16333 fn deser(
16334 _version: MavlinkVersion,
16335 __input: &[u8],
16336 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16337 let avail_len = __input.len();
16338 let mut payload_buf = [0; Self::ENCODED_LEN];
16339 let mut buf = if avail_len < Self::ENCODED_LEN {
16340 payload_buf[0..avail_len].copy_from_slice(__input);
16341 Bytes::new(&payload_buf)
16342 } else {
16343 Bytes::new(__input)
16344 };
16345 let mut __struct = Self::default();
16346 __struct.time_usec = buf.get_u64_le();
16347 __struct.roll_ailerons = buf.get_f32_le();
16348 __struct.pitch_elevator = buf.get_f32_le();
16349 __struct.yaw_rudder = buf.get_f32_le();
16350 __struct.throttle = buf.get_f32_le();
16351 __struct.aux1 = buf.get_f32_le();
16352 __struct.aux2 = buf.get_f32_le();
16353 __struct.aux3 = buf.get_f32_le();
16354 __struct.aux4 = buf.get_f32_le();
16355 let tmp = buf.get_u8();
16356 __struct.mode =
16357 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16358 enum_type: "MavMode",
16359 value: tmp as u32,
16360 })?;
16361 __struct.nav_mode = buf.get_u8();
16362 Ok(__struct)
16363 }
16364 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16365 let mut __tmp = BytesMut::new(bytes);
16366 #[allow(clippy::absurd_extreme_comparisons)]
16367 #[allow(unused_comparisons)]
16368 if __tmp.remaining() < Self::ENCODED_LEN {
16369 panic!(
16370 "buffer is too small (need {} bytes, but got {})",
16371 Self::ENCODED_LEN,
16372 __tmp.remaining(),
16373 )
16374 }
16375 __tmp.put_u64_le(self.time_usec);
16376 __tmp.put_f32_le(self.roll_ailerons);
16377 __tmp.put_f32_le(self.pitch_elevator);
16378 __tmp.put_f32_le(self.yaw_rudder);
16379 __tmp.put_f32_le(self.throttle);
16380 __tmp.put_f32_le(self.aux1);
16381 __tmp.put_f32_le(self.aux2);
16382 __tmp.put_f32_le(self.aux3);
16383 __tmp.put_f32_le(self.aux4);
16384 __tmp.put_u8(self.mode as u8);
16385 __tmp.put_u8(self.nav_mode);
16386 if matches!(version, MavlinkVersion::V2) {
16387 let len = __tmp.len();
16388 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16389 } else {
16390 __tmp.len()
16391 }
16392 }
16393}
16394#[doc = "id: 137"]
16395#[doc = "Barometer readings for 2nd barometer."]
16396#[derive(Debug, Clone, PartialEq)]
16397#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16398#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16399pub struct SCALED_PRESSURE2_DATA {
16400 #[doc = "Timestamp (time since system boot)."]
16401 pub time_boot_ms: u32,
16402 #[doc = "Absolute pressure"]
16403 pub press_abs: f32,
16404 #[doc = "Differential pressure"]
16405 pub press_diff: f32,
16406 #[doc = "Absolute pressure temperature"]
16407 pub temperature: i16,
16408 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
16409 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16410 pub temperature_press_diff: i16,
16411}
16412impl SCALED_PRESSURE2_DATA {
16413 pub const ENCODED_LEN: usize = 16usize;
16414 pub const DEFAULT: Self = Self {
16415 time_boot_ms: 0_u32,
16416 press_abs: 0.0_f32,
16417 press_diff: 0.0_f32,
16418 temperature: 0_i16,
16419 temperature_press_diff: 0_i16,
16420 };
16421 #[cfg(feature = "arbitrary")]
16422 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16423 use arbitrary::{Arbitrary, Unstructured};
16424 let mut buf = [0u8; 1024];
16425 rng.fill_bytes(&mut buf);
16426 let mut unstructured = Unstructured::new(&buf);
16427 Self::arbitrary(&mut unstructured).unwrap_or_default()
16428 }
16429}
16430impl Default for SCALED_PRESSURE2_DATA {
16431 fn default() -> Self {
16432 Self::DEFAULT.clone()
16433 }
16434}
16435impl MessageData for SCALED_PRESSURE2_DATA {
16436 type Message = MavMessage;
16437 const ID: u32 = 137u32;
16438 const NAME: &'static str = "SCALED_PRESSURE2";
16439 const EXTRA_CRC: u8 = 195u8;
16440 const ENCODED_LEN: usize = 16usize;
16441 fn deser(
16442 _version: MavlinkVersion,
16443 __input: &[u8],
16444 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16445 let avail_len = __input.len();
16446 let mut payload_buf = [0; Self::ENCODED_LEN];
16447 let mut buf = if avail_len < Self::ENCODED_LEN {
16448 payload_buf[0..avail_len].copy_from_slice(__input);
16449 Bytes::new(&payload_buf)
16450 } else {
16451 Bytes::new(__input)
16452 };
16453 let mut __struct = Self::default();
16454 __struct.time_boot_ms = buf.get_u32_le();
16455 __struct.press_abs = buf.get_f32_le();
16456 __struct.press_diff = buf.get_f32_le();
16457 __struct.temperature = buf.get_i16_le();
16458 __struct.temperature_press_diff = buf.get_i16_le();
16459 Ok(__struct)
16460 }
16461 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16462 let mut __tmp = BytesMut::new(bytes);
16463 #[allow(clippy::absurd_extreme_comparisons)]
16464 #[allow(unused_comparisons)]
16465 if __tmp.remaining() < Self::ENCODED_LEN {
16466 panic!(
16467 "buffer is too small (need {} bytes, but got {})",
16468 Self::ENCODED_LEN,
16469 __tmp.remaining(),
16470 )
16471 }
16472 __tmp.put_u32_le(self.time_boot_ms);
16473 __tmp.put_f32_le(self.press_abs);
16474 __tmp.put_f32_le(self.press_diff);
16475 __tmp.put_i16_le(self.temperature);
16476 __tmp.put_i16_le(self.temperature_press_diff);
16477 if matches!(version, MavlinkVersion::V2) {
16478 let len = __tmp.len();
16479 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16480 } else {
16481 __tmp.len()
16482 }
16483 }
16484}
16485#[doc = "id: 334"]
16486#[doc = "Report current used cellular network status."]
16487#[derive(Debug, Clone, PartialEq)]
16488#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16489#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16490pub struct CELLULAR_STATUS_DATA {
16491 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
16492 pub mcc: u16,
16493 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
16494 pub mnc: u16,
16495 #[doc = "Location area code. If unknown, set to 0"]
16496 pub lac: u16,
16497 #[doc = "Cellular modem status"]
16498 pub status: CellularStatusFlag,
16499 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
16500 pub failure_reason: CellularNetworkFailedReason,
16501 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
16502 pub mavtype: CellularNetworkRadioType,
16503 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
16504 pub quality: u8,
16505}
16506impl CELLULAR_STATUS_DATA {
16507 pub const ENCODED_LEN: usize = 10usize;
16508 pub const DEFAULT: Self = Self {
16509 mcc: 0_u16,
16510 mnc: 0_u16,
16511 lac: 0_u16,
16512 status: CellularStatusFlag::DEFAULT,
16513 failure_reason: CellularNetworkFailedReason::DEFAULT,
16514 mavtype: CellularNetworkRadioType::DEFAULT,
16515 quality: 0_u8,
16516 };
16517 #[cfg(feature = "arbitrary")]
16518 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16519 use arbitrary::{Arbitrary, Unstructured};
16520 let mut buf = [0u8; 1024];
16521 rng.fill_bytes(&mut buf);
16522 let mut unstructured = Unstructured::new(&buf);
16523 Self::arbitrary(&mut unstructured).unwrap_or_default()
16524 }
16525}
16526impl Default for CELLULAR_STATUS_DATA {
16527 fn default() -> Self {
16528 Self::DEFAULT.clone()
16529 }
16530}
16531impl MessageData for CELLULAR_STATUS_DATA {
16532 type Message = MavMessage;
16533 const ID: u32 = 334u32;
16534 const NAME: &'static str = "CELLULAR_STATUS";
16535 const EXTRA_CRC: u8 = 72u8;
16536 const ENCODED_LEN: usize = 10usize;
16537 fn deser(
16538 _version: MavlinkVersion,
16539 __input: &[u8],
16540 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16541 let avail_len = __input.len();
16542 let mut payload_buf = [0; Self::ENCODED_LEN];
16543 let mut buf = if avail_len < Self::ENCODED_LEN {
16544 payload_buf[0..avail_len].copy_from_slice(__input);
16545 Bytes::new(&payload_buf)
16546 } else {
16547 Bytes::new(__input)
16548 };
16549 let mut __struct = Self::default();
16550 __struct.mcc = buf.get_u16_le();
16551 __struct.mnc = buf.get_u16_le();
16552 __struct.lac = buf.get_u16_le();
16553 let tmp = buf.get_u8();
16554 __struct.status =
16555 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16556 enum_type: "CellularStatusFlag",
16557 value: tmp as u32,
16558 })?;
16559 let tmp = buf.get_u8();
16560 __struct.failure_reason =
16561 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16562 enum_type: "CellularNetworkFailedReason",
16563 value: tmp as u32,
16564 })?;
16565 let tmp = buf.get_u8();
16566 __struct.mavtype =
16567 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16568 enum_type: "CellularNetworkRadioType",
16569 value: tmp as u32,
16570 })?;
16571 __struct.quality = buf.get_u8();
16572 Ok(__struct)
16573 }
16574 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16575 let mut __tmp = BytesMut::new(bytes);
16576 #[allow(clippy::absurd_extreme_comparisons)]
16577 #[allow(unused_comparisons)]
16578 if __tmp.remaining() < Self::ENCODED_LEN {
16579 panic!(
16580 "buffer is too small (need {} bytes, but got {})",
16581 Self::ENCODED_LEN,
16582 __tmp.remaining(),
16583 )
16584 }
16585 __tmp.put_u16_le(self.mcc);
16586 __tmp.put_u16_le(self.mnc);
16587 __tmp.put_u16_le(self.lac);
16588 __tmp.put_u8(self.status as u8);
16589 __tmp.put_u8(self.failure_reason as u8);
16590 __tmp.put_u8(self.mavtype as u8);
16591 __tmp.put_u8(self.quality);
16592 if matches!(version, MavlinkVersion::V2) {
16593 let len = __tmp.len();
16594 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16595 } else {
16596 __tmp.len()
16597 }
16598 }
16599}
16600#[doc = "id: 60052"]
16601#[doc = "Drone IMU data. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
16602#[derive(Debug, Clone, PartialEq)]
16603#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16604#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16605pub struct AVSS_DRONE_IMU_DATA {
16606 #[doc = "Timestamp (time since FC boot)."]
16607 pub time_boot_ms: u32,
16608 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
16609 pub q1: f32,
16610 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
16611 pub q2: f32,
16612 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
16613 pub q3: f32,
16614 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
16615 pub q4: f32,
16616 #[doc = "X acceleration"]
16617 pub xacc: f32,
16618 #[doc = "Y acceleration"]
16619 pub yacc: f32,
16620 #[doc = "Z acceleration"]
16621 pub zacc: f32,
16622 #[doc = "Angular speed around X axis"]
16623 pub xgyro: f32,
16624 #[doc = "Angular speed around Y axis"]
16625 pub ygyro: f32,
16626 #[doc = "Angular speed around Z axis"]
16627 pub zgyro: f32,
16628}
16629impl AVSS_DRONE_IMU_DATA {
16630 pub const ENCODED_LEN: usize = 44usize;
16631 pub const DEFAULT: Self = Self {
16632 time_boot_ms: 0_u32,
16633 q1: 0.0_f32,
16634 q2: 0.0_f32,
16635 q3: 0.0_f32,
16636 q4: 0.0_f32,
16637 xacc: 0.0_f32,
16638 yacc: 0.0_f32,
16639 zacc: 0.0_f32,
16640 xgyro: 0.0_f32,
16641 ygyro: 0.0_f32,
16642 zgyro: 0.0_f32,
16643 };
16644 #[cfg(feature = "arbitrary")]
16645 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16646 use arbitrary::{Arbitrary, Unstructured};
16647 let mut buf = [0u8; 1024];
16648 rng.fill_bytes(&mut buf);
16649 let mut unstructured = Unstructured::new(&buf);
16650 Self::arbitrary(&mut unstructured).unwrap_or_default()
16651 }
16652}
16653impl Default for AVSS_DRONE_IMU_DATA {
16654 fn default() -> Self {
16655 Self::DEFAULT.clone()
16656 }
16657}
16658impl MessageData for AVSS_DRONE_IMU_DATA {
16659 type Message = MavMessage;
16660 const ID: u32 = 60052u32;
16661 const NAME: &'static str = "AVSS_DRONE_IMU";
16662 const EXTRA_CRC: u8 = 101u8;
16663 const ENCODED_LEN: usize = 44usize;
16664 fn deser(
16665 _version: MavlinkVersion,
16666 __input: &[u8],
16667 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16668 let avail_len = __input.len();
16669 let mut payload_buf = [0; Self::ENCODED_LEN];
16670 let mut buf = if avail_len < Self::ENCODED_LEN {
16671 payload_buf[0..avail_len].copy_from_slice(__input);
16672 Bytes::new(&payload_buf)
16673 } else {
16674 Bytes::new(__input)
16675 };
16676 let mut __struct = Self::default();
16677 __struct.time_boot_ms = buf.get_u32_le();
16678 __struct.q1 = buf.get_f32_le();
16679 __struct.q2 = buf.get_f32_le();
16680 __struct.q3 = buf.get_f32_le();
16681 __struct.q4 = buf.get_f32_le();
16682 __struct.xacc = buf.get_f32_le();
16683 __struct.yacc = buf.get_f32_le();
16684 __struct.zacc = buf.get_f32_le();
16685 __struct.xgyro = buf.get_f32_le();
16686 __struct.ygyro = buf.get_f32_le();
16687 __struct.zgyro = buf.get_f32_le();
16688 Ok(__struct)
16689 }
16690 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16691 let mut __tmp = BytesMut::new(bytes);
16692 #[allow(clippy::absurd_extreme_comparisons)]
16693 #[allow(unused_comparisons)]
16694 if __tmp.remaining() < Self::ENCODED_LEN {
16695 panic!(
16696 "buffer is too small (need {} bytes, but got {})",
16697 Self::ENCODED_LEN,
16698 __tmp.remaining(),
16699 )
16700 }
16701 __tmp.put_u32_le(self.time_boot_ms);
16702 __tmp.put_f32_le(self.q1);
16703 __tmp.put_f32_le(self.q2);
16704 __tmp.put_f32_le(self.q3);
16705 __tmp.put_f32_le(self.q4);
16706 __tmp.put_f32_le(self.xacc);
16707 __tmp.put_f32_le(self.yacc);
16708 __tmp.put_f32_le(self.zacc);
16709 __tmp.put_f32_le(self.xgyro);
16710 __tmp.put_f32_le(self.ygyro);
16711 __tmp.put_f32_le(self.zgyro);
16712 if matches!(version, MavlinkVersion::V2) {
16713 let len = __tmp.len();
16714 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16715 } else {
16716 __tmp.len()
16717 }
16718 }
16719}
16720#[doc = "id: 372"]
16721#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
16722#[derive(Debug, Clone, PartialEq)]
16723#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16724#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16725pub struct BATTERY_INFO_DATA {
16726 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
16727 pub discharge_minimum_voltage: f32,
16728 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
16729 pub charging_minimum_voltage: f32,
16730 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
16731 pub resting_minimum_voltage: f32,
16732 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
16733 pub charging_maximum_voltage: f32,
16734 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
16735 pub charging_maximum_current: f32,
16736 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
16737 pub nominal_voltage: f32,
16738 #[doc = "Maximum pack discharge current. 0: field not provided."]
16739 pub discharge_maximum_current: f32,
16740 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
16741 pub discharge_maximum_burst_current: f32,
16742 #[doc = "Fully charged design capacity. 0: field not provided."]
16743 pub design_capacity: f32,
16744 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
16745 pub full_charge_capacity: f32,
16746 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
16747 pub cycle_count: u16,
16748 #[doc = "Battery weight. 0: field not provided."]
16749 pub weight: u16,
16750 #[doc = "Battery ID"]
16751 pub id: u8,
16752 #[doc = "Function of the battery."]
16753 pub battery_function: MavBatteryFunction,
16754 #[doc = "Type (chemistry) of the battery."]
16755 pub mavtype: MavBatteryType,
16756 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
16757 pub state_of_health: u8,
16758 #[doc = "Number of battery cells in series. 0: field not provided."]
16759 pub cells_in_series: u8,
16760 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
16761 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16762 pub manufacture_date: [u8; 9],
16763 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
16764 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16765 pub serial_number: [u8; 32],
16766 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
16767 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16768 pub name: [u8; 50],
16769}
16770impl BATTERY_INFO_DATA {
16771 pub const ENCODED_LEN: usize = 140usize;
16772 pub const DEFAULT: Self = Self {
16773 discharge_minimum_voltage: 0.0_f32,
16774 charging_minimum_voltage: 0.0_f32,
16775 resting_minimum_voltage: 0.0_f32,
16776 charging_maximum_voltage: 0.0_f32,
16777 charging_maximum_current: 0.0_f32,
16778 nominal_voltage: 0.0_f32,
16779 discharge_maximum_current: 0.0_f32,
16780 discharge_maximum_burst_current: 0.0_f32,
16781 design_capacity: 0.0_f32,
16782 full_charge_capacity: 0.0_f32,
16783 cycle_count: 0_u16,
16784 weight: 0_u16,
16785 id: 0_u8,
16786 battery_function: MavBatteryFunction::DEFAULT,
16787 mavtype: MavBatteryType::DEFAULT,
16788 state_of_health: 0_u8,
16789 cells_in_series: 0_u8,
16790 manufacture_date: [0_u8; 9usize],
16791 serial_number: [0_u8; 32usize],
16792 name: [0_u8; 50usize],
16793 };
16794 #[cfg(feature = "arbitrary")]
16795 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16796 use arbitrary::{Arbitrary, Unstructured};
16797 let mut buf = [0u8; 1024];
16798 rng.fill_bytes(&mut buf);
16799 let mut unstructured = Unstructured::new(&buf);
16800 Self::arbitrary(&mut unstructured).unwrap_or_default()
16801 }
16802}
16803impl Default for BATTERY_INFO_DATA {
16804 fn default() -> Self {
16805 Self::DEFAULT.clone()
16806 }
16807}
16808impl MessageData for BATTERY_INFO_DATA {
16809 type Message = MavMessage;
16810 const ID: u32 = 372u32;
16811 const NAME: &'static str = "BATTERY_INFO";
16812 const EXTRA_CRC: u8 = 26u8;
16813 const ENCODED_LEN: usize = 140usize;
16814 fn deser(
16815 _version: MavlinkVersion,
16816 __input: &[u8],
16817 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16818 let avail_len = __input.len();
16819 let mut payload_buf = [0; Self::ENCODED_LEN];
16820 let mut buf = if avail_len < Self::ENCODED_LEN {
16821 payload_buf[0..avail_len].copy_from_slice(__input);
16822 Bytes::new(&payload_buf)
16823 } else {
16824 Bytes::new(__input)
16825 };
16826 let mut __struct = Self::default();
16827 __struct.discharge_minimum_voltage = buf.get_f32_le();
16828 __struct.charging_minimum_voltage = buf.get_f32_le();
16829 __struct.resting_minimum_voltage = buf.get_f32_le();
16830 __struct.charging_maximum_voltage = buf.get_f32_le();
16831 __struct.charging_maximum_current = buf.get_f32_le();
16832 __struct.nominal_voltage = buf.get_f32_le();
16833 __struct.discharge_maximum_current = buf.get_f32_le();
16834 __struct.discharge_maximum_burst_current = buf.get_f32_le();
16835 __struct.design_capacity = buf.get_f32_le();
16836 __struct.full_charge_capacity = buf.get_f32_le();
16837 __struct.cycle_count = buf.get_u16_le();
16838 __struct.weight = buf.get_u16_le();
16839 __struct.id = buf.get_u8();
16840 let tmp = buf.get_u8();
16841 __struct.battery_function =
16842 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16843 enum_type: "MavBatteryFunction",
16844 value: tmp as u32,
16845 })?;
16846 let tmp = buf.get_u8();
16847 __struct.mavtype =
16848 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16849 enum_type: "MavBatteryType",
16850 value: tmp as u32,
16851 })?;
16852 __struct.state_of_health = buf.get_u8();
16853 __struct.cells_in_series = buf.get_u8();
16854 for v in &mut __struct.manufacture_date {
16855 let val = buf.get_u8();
16856 *v = val;
16857 }
16858 for v in &mut __struct.serial_number {
16859 let val = buf.get_u8();
16860 *v = val;
16861 }
16862 for v in &mut __struct.name {
16863 let val = buf.get_u8();
16864 *v = val;
16865 }
16866 Ok(__struct)
16867 }
16868 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16869 let mut __tmp = BytesMut::new(bytes);
16870 #[allow(clippy::absurd_extreme_comparisons)]
16871 #[allow(unused_comparisons)]
16872 if __tmp.remaining() < Self::ENCODED_LEN {
16873 panic!(
16874 "buffer is too small (need {} bytes, but got {})",
16875 Self::ENCODED_LEN,
16876 __tmp.remaining(),
16877 )
16878 }
16879 __tmp.put_f32_le(self.discharge_minimum_voltage);
16880 __tmp.put_f32_le(self.charging_minimum_voltage);
16881 __tmp.put_f32_le(self.resting_minimum_voltage);
16882 __tmp.put_f32_le(self.charging_maximum_voltage);
16883 __tmp.put_f32_le(self.charging_maximum_current);
16884 __tmp.put_f32_le(self.nominal_voltage);
16885 __tmp.put_f32_le(self.discharge_maximum_current);
16886 __tmp.put_f32_le(self.discharge_maximum_burst_current);
16887 __tmp.put_f32_le(self.design_capacity);
16888 __tmp.put_f32_le(self.full_charge_capacity);
16889 __tmp.put_u16_le(self.cycle_count);
16890 __tmp.put_u16_le(self.weight);
16891 __tmp.put_u8(self.id);
16892 __tmp.put_u8(self.battery_function as u8);
16893 __tmp.put_u8(self.mavtype as u8);
16894 __tmp.put_u8(self.state_of_health);
16895 __tmp.put_u8(self.cells_in_series);
16896 for val in &self.manufacture_date {
16897 __tmp.put_u8(*val);
16898 }
16899 for val in &self.serial_number {
16900 __tmp.put_u8(*val);
16901 }
16902 for val in &self.name {
16903 __tmp.put_u8(*val);
16904 }
16905 if matches!(version, MavlinkVersion::V2) {
16906 let len = __tmp.len();
16907 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16908 } else {
16909 __tmp.len()
16910 }
16911 }
16912}
16913#[doc = "id: 11"]
16914#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
16915#[derive(Debug, Clone, PartialEq)]
16916#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16917#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16918pub struct SET_MODE_DATA {
16919 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
16920 pub custom_mode: u32,
16921 #[doc = "The system setting the mode"]
16922 pub target_system: u8,
16923 #[doc = "The new base mode."]
16924 pub base_mode: MavMode,
16925}
16926impl SET_MODE_DATA {
16927 pub const ENCODED_LEN: usize = 6usize;
16928 pub const DEFAULT: Self = Self {
16929 custom_mode: 0_u32,
16930 target_system: 0_u8,
16931 base_mode: MavMode::DEFAULT,
16932 };
16933 #[cfg(feature = "arbitrary")]
16934 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16935 use arbitrary::{Arbitrary, Unstructured};
16936 let mut buf = [0u8; 1024];
16937 rng.fill_bytes(&mut buf);
16938 let mut unstructured = Unstructured::new(&buf);
16939 Self::arbitrary(&mut unstructured).unwrap_or_default()
16940 }
16941}
16942impl Default for SET_MODE_DATA {
16943 fn default() -> Self {
16944 Self::DEFAULT.clone()
16945 }
16946}
16947impl MessageData for SET_MODE_DATA {
16948 type Message = MavMessage;
16949 const ID: u32 = 11u32;
16950 const NAME: &'static str = "SET_MODE";
16951 const EXTRA_CRC: u8 = 89u8;
16952 const ENCODED_LEN: usize = 6usize;
16953 fn deser(
16954 _version: MavlinkVersion,
16955 __input: &[u8],
16956 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16957 let avail_len = __input.len();
16958 let mut payload_buf = [0; Self::ENCODED_LEN];
16959 let mut buf = if avail_len < Self::ENCODED_LEN {
16960 payload_buf[0..avail_len].copy_from_slice(__input);
16961 Bytes::new(&payload_buf)
16962 } else {
16963 Bytes::new(__input)
16964 };
16965 let mut __struct = Self::default();
16966 __struct.custom_mode = buf.get_u32_le();
16967 __struct.target_system = buf.get_u8();
16968 let tmp = buf.get_u8();
16969 __struct.base_mode =
16970 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16971 enum_type: "MavMode",
16972 value: tmp as u32,
16973 })?;
16974 Ok(__struct)
16975 }
16976 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16977 let mut __tmp = BytesMut::new(bytes);
16978 #[allow(clippy::absurd_extreme_comparisons)]
16979 #[allow(unused_comparisons)]
16980 if __tmp.remaining() < Self::ENCODED_LEN {
16981 panic!(
16982 "buffer is too small (need {} bytes, but got {})",
16983 Self::ENCODED_LEN,
16984 __tmp.remaining(),
16985 )
16986 }
16987 __tmp.put_u32_le(self.custom_mode);
16988 __tmp.put_u8(self.target_system);
16989 __tmp.put_u8(self.base_mode as u8);
16990 if matches!(version, MavlinkVersion::V2) {
16991 let len = __tmp.len();
16992 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16993 } else {
16994 __tmp.len()
16995 }
16996 }
16997}
16998#[doc = "id: 270"]
16999#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
17000#[derive(Debug, Clone, PartialEq)]
17001#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17002#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17003pub struct VIDEO_STREAM_STATUS_DATA {
17004 #[doc = "Frame rate"]
17005 pub framerate: f32,
17006 #[doc = "Bit rate"]
17007 pub bitrate: u32,
17008 #[doc = "Bitmap of stream status flags"]
17009 pub flags: VideoStreamStatusFlags,
17010 #[doc = "Horizontal resolution"]
17011 pub resolution_h: u16,
17012 #[doc = "Vertical resolution"]
17013 pub resolution_v: u16,
17014 #[doc = "Video image rotation clockwise"]
17015 pub rotation: u16,
17016 #[doc = "Horizontal Field of view"]
17017 pub hfov: u16,
17018 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
17019 pub stream_id: u8,
17020 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
17021 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17022 pub camera_device_id: u8,
17023}
17024impl VIDEO_STREAM_STATUS_DATA {
17025 pub const ENCODED_LEN: usize = 20usize;
17026 pub const DEFAULT: Self = Self {
17027 framerate: 0.0_f32,
17028 bitrate: 0_u32,
17029 flags: VideoStreamStatusFlags::DEFAULT,
17030 resolution_h: 0_u16,
17031 resolution_v: 0_u16,
17032 rotation: 0_u16,
17033 hfov: 0_u16,
17034 stream_id: 0_u8,
17035 camera_device_id: 0_u8,
17036 };
17037 #[cfg(feature = "arbitrary")]
17038 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17039 use arbitrary::{Arbitrary, Unstructured};
17040 let mut buf = [0u8; 1024];
17041 rng.fill_bytes(&mut buf);
17042 let mut unstructured = Unstructured::new(&buf);
17043 Self::arbitrary(&mut unstructured).unwrap_or_default()
17044 }
17045}
17046impl Default for VIDEO_STREAM_STATUS_DATA {
17047 fn default() -> Self {
17048 Self::DEFAULT.clone()
17049 }
17050}
17051impl MessageData for VIDEO_STREAM_STATUS_DATA {
17052 type Message = MavMessage;
17053 const ID: u32 = 270u32;
17054 const NAME: &'static str = "VIDEO_STREAM_STATUS";
17055 const EXTRA_CRC: u8 = 59u8;
17056 const ENCODED_LEN: usize = 20usize;
17057 fn deser(
17058 _version: MavlinkVersion,
17059 __input: &[u8],
17060 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17061 let avail_len = __input.len();
17062 let mut payload_buf = [0; Self::ENCODED_LEN];
17063 let mut buf = if avail_len < Self::ENCODED_LEN {
17064 payload_buf[0..avail_len].copy_from_slice(__input);
17065 Bytes::new(&payload_buf)
17066 } else {
17067 Bytes::new(__input)
17068 };
17069 let mut __struct = Self::default();
17070 __struct.framerate = buf.get_f32_le();
17071 __struct.bitrate = buf.get_u32_le();
17072 let tmp = buf.get_u16_le();
17073 __struct.flags = VideoStreamStatusFlags::from_bits(
17074 tmp & VideoStreamStatusFlags::all().bits(),
17075 )
17076 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17077 flag_type: "VideoStreamStatusFlags",
17078 value: tmp as u32,
17079 })?;
17080 __struct.resolution_h = buf.get_u16_le();
17081 __struct.resolution_v = buf.get_u16_le();
17082 __struct.rotation = buf.get_u16_le();
17083 __struct.hfov = buf.get_u16_le();
17084 __struct.stream_id = buf.get_u8();
17085 __struct.camera_device_id = buf.get_u8();
17086 Ok(__struct)
17087 }
17088 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17089 let mut __tmp = BytesMut::new(bytes);
17090 #[allow(clippy::absurd_extreme_comparisons)]
17091 #[allow(unused_comparisons)]
17092 if __tmp.remaining() < Self::ENCODED_LEN {
17093 panic!(
17094 "buffer is too small (need {} bytes, but got {})",
17095 Self::ENCODED_LEN,
17096 __tmp.remaining(),
17097 )
17098 }
17099 __tmp.put_f32_le(self.framerate);
17100 __tmp.put_u32_le(self.bitrate);
17101 __tmp.put_u16_le(self.flags.bits());
17102 __tmp.put_u16_le(self.resolution_h);
17103 __tmp.put_u16_le(self.resolution_v);
17104 __tmp.put_u16_le(self.rotation);
17105 __tmp.put_u16_le(self.hfov);
17106 __tmp.put_u8(self.stream_id);
17107 __tmp.put_u8(self.camera_device_id);
17108 if matches!(version, MavlinkVersion::V2) {
17109 let len = __tmp.len();
17110 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17111 } else {
17112 __tmp.len()
17113 }
17114 }
17115}
17116#[doc = "id: 12918"]
17117#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
17118#[derive(Debug, Clone, PartialEq)]
17119#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17120#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17121pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
17122 #[doc = "Status level indicating if arming is allowed."]
17123 pub status: MavOdidArmStatus,
17124 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
17125 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17126 pub error: [u8; 50],
17127}
17128impl OPEN_DRONE_ID_ARM_STATUS_DATA {
17129 pub const ENCODED_LEN: usize = 51usize;
17130 pub const DEFAULT: Self = Self {
17131 status: MavOdidArmStatus::DEFAULT,
17132 error: [0_u8; 50usize],
17133 };
17134 #[cfg(feature = "arbitrary")]
17135 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17136 use arbitrary::{Arbitrary, Unstructured};
17137 let mut buf = [0u8; 1024];
17138 rng.fill_bytes(&mut buf);
17139 let mut unstructured = Unstructured::new(&buf);
17140 Self::arbitrary(&mut unstructured).unwrap_or_default()
17141 }
17142}
17143impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
17144 fn default() -> Self {
17145 Self::DEFAULT.clone()
17146 }
17147}
17148impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
17149 type Message = MavMessage;
17150 const ID: u32 = 12918u32;
17151 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
17152 const EXTRA_CRC: u8 = 139u8;
17153 const ENCODED_LEN: usize = 51usize;
17154 fn deser(
17155 _version: MavlinkVersion,
17156 __input: &[u8],
17157 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17158 let avail_len = __input.len();
17159 let mut payload_buf = [0; Self::ENCODED_LEN];
17160 let mut buf = if avail_len < Self::ENCODED_LEN {
17161 payload_buf[0..avail_len].copy_from_slice(__input);
17162 Bytes::new(&payload_buf)
17163 } else {
17164 Bytes::new(__input)
17165 };
17166 let mut __struct = Self::default();
17167 let tmp = buf.get_u8();
17168 __struct.status =
17169 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17170 enum_type: "MavOdidArmStatus",
17171 value: tmp as u32,
17172 })?;
17173 for v in &mut __struct.error {
17174 let val = buf.get_u8();
17175 *v = val;
17176 }
17177 Ok(__struct)
17178 }
17179 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17180 let mut __tmp = BytesMut::new(bytes);
17181 #[allow(clippy::absurd_extreme_comparisons)]
17182 #[allow(unused_comparisons)]
17183 if __tmp.remaining() < Self::ENCODED_LEN {
17184 panic!(
17185 "buffer is too small (need {} bytes, but got {})",
17186 Self::ENCODED_LEN,
17187 __tmp.remaining(),
17188 )
17189 }
17190 __tmp.put_u8(self.status as u8);
17191 for val in &self.error {
17192 __tmp.put_u8(*val);
17193 }
17194 if matches!(version, MavlinkVersion::V2) {
17195 let len = __tmp.len();
17196 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17197 } else {
17198 __tmp.len()
17199 }
17200 }
17201}
17202#[doc = "id: 124"]
17203#[doc = "Second GPS data."]
17204#[derive(Debug, Clone, PartialEq)]
17205#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17206#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17207pub struct GPS2_RAW_DATA {
17208 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17209 pub time_usec: u64,
17210 #[doc = "Latitude (WGS84)"]
17211 pub lat: i32,
17212 #[doc = "Longitude (WGS84)"]
17213 pub lon: i32,
17214 #[doc = "Altitude (MSL). Positive for up."]
17215 pub alt: i32,
17216 #[doc = "Age of DGPS info"]
17217 pub dgps_age: u32,
17218 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
17219 pub eph: u16,
17220 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
17221 pub epv: u16,
17222 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
17223 pub vel: u16,
17224 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
17225 pub cog: u16,
17226 #[doc = "GPS fix type."]
17227 pub fix_type: GpsFixType,
17228 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
17229 pub satellites_visible: u8,
17230 #[doc = "Number of DGPS satellites"]
17231 pub dgps_numch: u8,
17232 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
17233 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17234 pub yaw: u16,
17235 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
17236 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17237 pub alt_ellipsoid: i32,
17238 #[doc = "Position uncertainty."]
17239 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17240 pub h_acc: u32,
17241 #[doc = "Altitude uncertainty."]
17242 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17243 pub v_acc: u32,
17244 #[doc = "Speed uncertainty."]
17245 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17246 pub vel_acc: u32,
17247 #[doc = "Heading / track uncertainty"]
17248 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17249 pub hdg_acc: u32,
17250}
17251impl GPS2_RAW_DATA {
17252 pub const ENCODED_LEN: usize = 57usize;
17253 pub const DEFAULT: Self = Self {
17254 time_usec: 0_u64,
17255 lat: 0_i32,
17256 lon: 0_i32,
17257 alt: 0_i32,
17258 dgps_age: 0_u32,
17259 eph: 0_u16,
17260 epv: 0_u16,
17261 vel: 0_u16,
17262 cog: 0_u16,
17263 fix_type: GpsFixType::DEFAULT,
17264 satellites_visible: 0_u8,
17265 dgps_numch: 0_u8,
17266 yaw: 0_u16,
17267 alt_ellipsoid: 0_i32,
17268 h_acc: 0_u32,
17269 v_acc: 0_u32,
17270 vel_acc: 0_u32,
17271 hdg_acc: 0_u32,
17272 };
17273 #[cfg(feature = "arbitrary")]
17274 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17275 use arbitrary::{Arbitrary, Unstructured};
17276 let mut buf = [0u8; 1024];
17277 rng.fill_bytes(&mut buf);
17278 let mut unstructured = Unstructured::new(&buf);
17279 Self::arbitrary(&mut unstructured).unwrap_or_default()
17280 }
17281}
17282impl Default for GPS2_RAW_DATA {
17283 fn default() -> Self {
17284 Self::DEFAULT.clone()
17285 }
17286}
17287impl MessageData for GPS2_RAW_DATA {
17288 type Message = MavMessage;
17289 const ID: u32 = 124u32;
17290 const NAME: &'static str = "GPS2_RAW";
17291 const EXTRA_CRC: u8 = 87u8;
17292 const ENCODED_LEN: usize = 57usize;
17293 fn deser(
17294 _version: MavlinkVersion,
17295 __input: &[u8],
17296 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17297 let avail_len = __input.len();
17298 let mut payload_buf = [0; Self::ENCODED_LEN];
17299 let mut buf = if avail_len < Self::ENCODED_LEN {
17300 payload_buf[0..avail_len].copy_from_slice(__input);
17301 Bytes::new(&payload_buf)
17302 } else {
17303 Bytes::new(__input)
17304 };
17305 let mut __struct = Self::default();
17306 __struct.time_usec = buf.get_u64_le();
17307 __struct.lat = buf.get_i32_le();
17308 __struct.lon = buf.get_i32_le();
17309 __struct.alt = buf.get_i32_le();
17310 __struct.dgps_age = buf.get_u32_le();
17311 __struct.eph = buf.get_u16_le();
17312 __struct.epv = buf.get_u16_le();
17313 __struct.vel = buf.get_u16_le();
17314 __struct.cog = buf.get_u16_le();
17315 let tmp = buf.get_u8();
17316 __struct.fix_type =
17317 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17318 enum_type: "GpsFixType",
17319 value: tmp as u32,
17320 })?;
17321 __struct.satellites_visible = buf.get_u8();
17322 __struct.dgps_numch = buf.get_u8();
17323 __struct.yaw = buf.get_u16_le();
17324 __struct.alt_ellipsoid = buf.get_i32_le();
17325 __struct.h_acc = buf.get_u32_le();
17326 __struct.v_acc = buf.get_u32_le();
17327 __struct.vel_acc = buf.get_u32_le();
17328 __struct.hdg_acc = buf.get_u32_le();
17329 Ok(__struct)
17330 }
17331 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17332 let mut __tmp = BytesMut::new(bytes);
17333 #[allow(clippy::absurd_extreme_comparisons)]
17334 #[allow(unused_comparisons)]
17335 if __tmp.remaining() < Self::ENCODED_LEN {
17336 panic!(
17337 "buffer is too small (need {} bytes, but got {})",
17338 Self::ENCODED_LEN,
17339 __tmp.remaining(),
17340 )
17341 }
17342 __tmp.put_u64_le(self.time_usec);
17343 __tmp.put_i32_le(self.lat);
17344 __tmp.put_i32_le(self.lon);
17345 __tmp.put_i32_le(self.alt);
17346 __tmp.put_u32_le(self.dgps_age);
17347 __tmp.put_u16_le(self.eph);
17348 __tmp.put_u16_le(self.epv);
17349 __tmp.put_u16_le(self.vel);
17350 __tmp.put_u16_le(self.cog);
17351 __tmp.put_u8(self.fix_type as u8);
17352 __tmp.put_u8(self.satellites_visible);
17353 __tmp.put_u8(self.dgps_numch);
17354 __tmp.put_u16_le(self.yaw);
17355 __tmp.put_i32_le(self.alt_ellipsoid);
17356 __tmp.put_u32_le(self.h_acc);
17357 __tmp.put_u32_le(self.v_acc);
17358 __tmp.put_u32_le(self.vel_acc);
17359 __tmp.put_u32_le(self.hdg_acc);
17360 if matches!(version, MavlinkVersion::V2) {
17361 let len = __tmp.len();
17362 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17363 } else {
17364 __tmp.len()
17365 }
17366 }
17367}
17368#[doc = "id: 2"]
17369#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
17370#[derive(Debug, Clone, PartialEq)]
17371#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17372#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17373pub struct SYSTEM_TIME_DATA {
17374 #[doc = "Timestamp (UNIX epoch time)."]
17375 pub time_unix_usec: u64,
17376 #[doc = "Timestamp (time since system boot)."]
17377 pub time_boot_ms: u32,
17378}
17379impl SYSTEM_TIME_DATA {
17380 pub const ENCODED_LEN: usize = 12usize;
17381 pub const DEFAULT: Self = Self {
17382 time_unix_usec: 0_u64,
17383 time_boot_ms: 0_u32,
17384 };
17385 #[cfg(feature = "arbitrary")]
17386 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17387 use arbitrary::{Arbitrary, Unstructured};
17388 let mut buf = [0u8; 1024];
17389 rng.fill_bytes(&mut buf);
17390 let mut unstructured = Unstructured::new(&buf);
17391 Self::arbitrary(&mut unstructured).unwrap_or_default()
17392 }
17393}
17394impl Default for SYSTEM_TIME_DATA {
17395 fn default() -> Self {
17396 Self::DEFAULT.clone()
17397 }
17398}
17399impl MessageData for SYSTEM_TIME_DATA {
17400 type Message = MavMessage;
17401 const ID: u32 = 2u32;
17402 const NAME: &'static str = "SYSTEM_TIME";
17403 const EXTRA_CRC: u8 = 137u8;
17404 const ENCODED_LEN: usize = 12usize;
17405 fn deser(
17406 _version: MavlinkVersion,
17407 __input: &[u8],
17408 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17409 let avail_len = __input.len();
17410 let mut payload_buf = [0; Self::ENCODED_LEN];
17411 let mut buf = if avail_len < Self::ENCODED_LEN {
17412 payload_buf[0..avail_len].copy_from_slice(__input);
17413 Bytes::new(&payload_buf)
17414 } else {
17415 Bytes::new(__input)
17416 };
17417 let mut __struct = Self::default();
17418 __struct.time_unix_usec = buf.get_u64_le();
17419 __struct.time_boot_ms = buf.get_u32_le();
17420 Ok(__struct)
17421 }
17422 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17423 let mut __tmp = BytesMut::new(bytes);
17424 #[allow(clippy::absurd_extreme_comparisons)]
17425 #[allow(unused_comparisons)]
17426 if __tmp.remaining() < Self::ENCODED_LEN {
17427 panic!(
17428 "buffer is too small (need {} bytes, but got {})",
17429 Self::ENCODED_LEN,
17430 __tmp.remaining(),
17431 )
17432 }
17433 __tmp.put_u64_le(self.time_unix_usec);
17434 __tmp.put_u32_le(self.time_boot_ms);
17435 if matches!(version, MavlinkVersion::V2) {
17436 let len = __tmp.len();
17437 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17438 } else {
17439 __tmp.len()
17440 }
17441 }
17442}
17443#[doc = "id: 87"]
17444#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
17445#[derive(Debug, Clone, PartialEq)]
17446#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17447#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17448pub struct POSITION_TARGET_GLOBAL_INT_DATA {
17449 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
17450 pub time_boot_ms: u32,
17451 #[doc = "Latitude in WGS84 frame"]
17452 pub lat_int: i32,
17453 #[doc = "Longitude in WGS84 frame"]
17454 pub lon_int: i32,
17455 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
17456 pub alt: f32,
17457 #[doc = "X velocity in NED frame"]
17458 pub vx: f32,
17459 #[doc = "Y velocity in NED frame"]
17460 pub vy: f32,
17461 #[doc = "Z velocity in NED frame"]
17462 pub vz: f32,
17463 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
17464 pub afx: f32,
17465 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
17466 pub afy: f32,
17467 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
17468 pub afz: f32,
17469 #[doc = "yaw setpoint"]
17470 pub yaw: f32,
17471 #[doc = "yaw rate setpoint"]
17472 pub yaw_rate: f32,
17473 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
17474 pub type_mask: PositionTargetTypemask,
17475 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
17476 pub coordinate_frame: MavFrame,
17477}
17478impl POSITION_TARGET_GLOBAL_INT_DATA {
17479 pub const ENCODED_LEN: usize = 51usize;
17480 pub const DEFAULT: Self = Self {
17481 time_boot_ms: 0_u32,
17482 lat_int: 0_i32,
17483 lon_int: 0_i32,
17484 alt: 0.0_f32,
17485 vx: 0.0_f32,
17486 vy: 0.0_f32,
17487 vz: 0.0_f32,
17488 afx: 0.0_f32,
17489 afy: 0.0_f32,
17490 afz: 0.0_f32,
17491 yaw: 0.0_f32,
17492 yaw_rate: 0.0_f32,
17493 type_mask: PositionTargetTypemask::DEFAULT,
17494 coordinate_frame: MavFrame::DEFAULT,
17495 };
17496 #[cfg(feature = "arbitrary")]
17497 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17498 use arbitrary::{Arbitrary, Unstructured};
17499 let mut buf = [0u8; 1024];
17500 rng.fill_bytes(&mut buf);
17501 let mut unstructured = Unstructured::new(&buf);
17502 Self::arbitrary(&mut unstructured).unwrap_or_default()
17503 }
17504}
17505impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
17506 fn default() -> Self {
17507 Self::DEFAULT.clone()
17508 }
17509}
17510impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
17511 type Message = MavMessage;
17512 const ID: u32 = 87u32;
17513 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
17514 const EXTRA_CRC: u8 = 150u8;
17515 const ENCODED_LEN: usize = 51usize;
17516 fn deser(
17517 _version: MavlinkVersion,
17518 __input: &[u8],
17519 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17520 let avail_len = __input.len();
17521 let mut payload_buf = [0; Self::ENCODED_LEN];
17522 let mut buf = if avail_len < Self::ENCODED_LEN {
17523 payload_buf[0..avail_len].copy_from_slice(__input);
17524 Bytes::new(&payload_buf)
17525 } else {
17526 Bytes::new(__input)
17527 };
17528 let mut __struct = Self::default();
17529 __struct.time_boot_ms = buf.get_u32_le();
17530 __struct.lat_int = buf.get_i32_le();
17531 __struct.lon_int = buf.get_i32_le();
17532 __struct.alt = buf.get_f32_le();
17533 __struct.vx = buf.get_f32_le();
17534 __struct.vy = buf.get_f32_le();
17535 __struct.vz = buf.get_f32_le();
17536 __struct.afx = buf.get_f32_le();
17537 __struct.afy = buf.get_f32_le();
17538 __struct.afz = buf.get_f32_le();
17539 __struct.yaw = buf.get_f32_le();
17540 __struct.yaw_rate = buf.get_f32_le();
17541 let tmp = buf.get_u16_le();
17542 __struct.type_mask = PositionTargetTypemask::from_bits(
17543 tmp & PositionTargetTypemask::all().bits(),
17544 )
17545 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17546 flag_type: "PositionTargetTypemask",
17547 value: tmp as u32,
17548 })?;
17549 let tmp = buf.get_u8();
17550 __struct.coordinate_frame =
17551 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17552 enum_type: "MavFrame",
17553 value: tmp as u32,
17554 })?;
17555 Ok(__struct)
17556 }
17557 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17558 let mut __tmp = BytesMut::new(bytes);
17559 #[allow(clippy::absurd_extreme_comparisons)]
17560 #[allow(unused_comparisons)]
17561 if __tmp.remaining() < Self::ENCODED_LEN {
17562 panic!(
17563 "buffer is too small (need {} bytes, but got {})",
17564 Self::ENCODED_LEN,
17565 __tmp.remaining(),
17566 )
17567 }
17568 __tmp.put_u32_le(self.time_boot_ms);
17569 __tmp.put_i32_le(self.lat_int);
17570 __tmp.put_i32_le(self.lon_int);
17571 __tmp.put_f32_le(self.alt);
17572 __tmp.put_f32_le(self.vx);
17573 __tmp.put_f32_le(self.vy);
17574 __tmp.put_f32_le(self.vz);
17575 __tmp.put_f32_le(self.afx);
17576 __tmp.put_f32_le(self.afy);
17577 __tmp.put_f32_le(self.afz);
17578 __tmp.put_f32_le(self.yaw);
17579 __tmp.put_f32_le(self.yaw_rate);
17580 __tmp.put_u16_le(self.type_mask.bits());
17581 __tmp.put_u8(self.coordinate_frame as u8);
17582 if matches!(version, MavlinkVersion::V2) {
17583 let len = __tmp.len();
17584 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17585 } else {
17586 __tmp.len()
17587 }
17588 }
17589}
17590#[doc = "id: 286"]
17591#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
17592#[derive(Debug, Clone, PartialEq)]
17593#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17594#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17595pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
17596 #[doc = "Timestamp (time since system boot)."]
17597 pub time_boot_us: u64,
17598 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
17599 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17600 pub q: [f32; 4],
17601 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
17602 pub q_estimated_delay_us: u32,
17603 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
17604 pub vx: f32,
17605 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
17606 pub vy: f32,
17607 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
17608 pub vz: f32,
17609 #[doc = "Estimated delay of the speed data. 0 if unknown."]
17610 pub v_estimated_delay_us: u32,
17611 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
17612 pub feed_forward_angular_velocity_z: f32,
17613 #[doc = "Bitmap indicating which estimator outputs are valid."]
17614 pub estimator_status: EstimatorStatusFlags,
17615 #[doc = "System ID"]
17616 pub target_system: u8,
17617 #[doc = "Component ID"]
17618 pub target_component: u8,
17619 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
17620 pub landed_state: MavLandedState,
17621 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
17622 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17623 pub angular_velocity_z: f32,
17624}
17625impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
17626 pub const ENCODED_LEN: usize = 57usize;
17627 pub const DEFAULT: Self = Self {
17628 time_boot_us: 0_u64,
17629 q: [0.0_f32; 4usize],
17630 q_estimated_delay_us: 0_u32,
17631 vx: 0.0_f32,
17632 vy: 0.0_f32,
17633 vz: 0.0_f32,
17634 v_estimated_delay_us: 0_u32,
17635 feed_forward_angular_velocity_z: 0.0_f32,
17636 estimator_status: EstimatorStatusFlags::DEFAULT,
17637 target_system: 0_u8,
17638 target_component: 0_u8,
17639 landed_state: MavLandedState::DEFAULT,
17640 angular_velocity_z: 0.0_f32,
17641 };
17642 #[cfg(feature = "arbitrary")]
17643 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17644 use arbitrary::{Arbitrary, Unstructured};
17645 let mut buf = [0u8; 1024];
17646 rng.fill_bytes(&mut buf);
17647 let mut unstructured = Unstructured::new(&buf);
17648 Self::arbitrary(&mut unstructured).unwrap_or_default()
17649 }
17650}
17651impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
17652 fn default() -> Self {
17653 Self::DEFAULT.clone()
17654 }
17655}
17656impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
17657 type Message = MavMessage;
17658 const ID: u32 = 286u32;
17659 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
17660 const EXTRA_CRC: u8 = 210u8;
17661 const ENCODED_LEN: usize = 57usize;
17662 fn deser(
17663 _version: MavlinkVersion,
17664 __input: &[u8],
17665 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17666 let avail_len = __input.len();
17667 let mut payload_buf = [0; Self::ENCODED_LEN];
17668 let mut buf = if avail_len < Self::ENCODED_LEN {
17669 payload_buf[0..avail_len].copy_from_slice(__input);
17670 Bytes::new(&payload_buf)
17671 } else {
17672 Bytes::new(__input)
17673 };
17674 let mut __struct = Self::default();
17675 __struct.time_boot_us = buf.get_u64_le();
17676 for v in &mut __struct.q {
17677 let val = buf.get_f32_le();
17678 *v = val;
17679 }
17680 __struct.q_estimated_delay_us = buf.get_u32_le();
17681 __struct.vx = buf.get_f32_le();
17682 __struct.vy = buf.get_f32_le();
17683 __struct.vz = buf.get_f32_le();
17684 __struct.v_estimated_delay_us = buf.get_u32_le();
17685 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
17686 let tmp = buf.get_u16_le();
17687 __struct.estimator_status = EstimatorStatusFlags::from_bits(
17688 tmp & EstimatorStatusFlags::all().bits(),
17689 )
17690 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
17691 flag_type: "EstimatorStatusFlags",
17692 value: tmp as u32,
17693 })?;
17694 __struct.target_system = buf.get_u8();
17695 __struct.target_component = buf.get_u8();
17696 let tmp = buf.get_u8();
17697 __struct.landed_state =
17698 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17699 enum_type: "MavLandedState",
17700 value: tmp as u32,
17701 })?;
17702 __struct.angular_velocity_z = buf.get_f32_le();
17703 Ok(__struct)
17704 }
17705 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17706 let mut __tmp = BytesMut::new(bytes);
17707 #[allow(clippy::absurd_extreme_comparisons)]
17708 #[allow(unused_comparisons)]
17709 if __tmp.remaining() < Self::ENCODED_LEN {
17710 panic!(
17711 "buffer is too small (need {} bytes, but got {})",
17712 Self::ENCODED_LEN,
17713 __tmp.remaining(),
17714 )
17715 }
17716 __tmp.put_u64_le(self.time_boot_us);
17717 for val in &self.q {
17718 __tmp.put_f32_le(*val);
17719 }
17720 __tmp.put_u32_le(self.q_estimated_delay_us);
17721 __tmp.put_f32_le(self.vx);
17722 __tmp.put_f32_le(self.vy);
17723 __tmp.put_f32_le(self.vz);
17724 __tmp.put_u32_le(self.v_estimated_delay_us);
17725 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
17726 __tmp.put_u16_le(self.estimator_status.bits());
17727 __tmp.put_u8(self.target_system);
17728 __tmp.put_u8(self.target_component);
17729 __tmp.put_u8(self.landed_state as u8);
17730 __tmp.put_f32_le(self.angular_velocity_z);
17731 if matches!(version, MavlinkVersion::V2) {
17732 let len = __tmp.len();
17733 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17734 } else {
17735 __tmp.len()
17736 }
17737 }
17738}
17739#[doc = "id: 332"]
17740#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
17741#[derive(Debug, Clone, PartialEq)]
17742#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17743#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17744pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
17745 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17746 pub time_usec: u64,
17747 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
17748 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17749 pub pos_x: [f32; 5],
17750 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
17751 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17752 pub pos_y: [f32; 5],
17753 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
17754 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17755 pub pos_z: [f32; 5],
17756 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
17757 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17758 pub vel_x: [f32; 5],
17759 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
17760 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17761 pub vel_y: [f32; 5],
17762 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
17763 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17764 pub vel_z: [f32; 5],
17765 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
17766 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17767 pub acc_x: [f32; 5],
17768 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
17769 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17770 pub acc_y: [f32; 5],
17771 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
17772 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17773 pub acc_z: [f32; 5],
17774 #[doc = "Yaw angle, set to NaN if not being used"]
17775 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17776 pub pos_yaw: [f32; 5],
17777 #[doc = "Yaw rate, set to NaN if not being used"]
17778 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17779 pub vel_yaw: [f32; 5],
17780 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
17781 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17782 pub command: [u16; 5],
17783 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
17784 pub valid_points: u8,
17785}
17786impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
17787 pub const ENCODED_LEN: usize = 239usize;
17788 pub const DEFAULT: Self = Self {
17789 time_usec: 0_u64,
17790 pos_x: [0.0_f32; 5usize],
17791 pos_y: [0.0_f32; 5usize],
17792 pos_z: [0.0_f32; 5usize],
17793 vel_x: [0.0_f32; 5usize],
17794 vel_y: [0.0_f32; 5usize],
17795 vel_z: [0.0_f32; 5usize],
17796 acc_x: [0.0_f32; 5usize],
17797 acc_y: [0.0_f32; 5usize],
17798 acc_z: [0.0_f32; 5usize],
17799 pos_yaw: [0.0_f32; 5usize],
17800 vel_yaw: [0.0_f32; 5usize],
17801 command: [0_u16; 5usize],
17802 valid_points: 0_u8,
17803 };
17804 #[cfg(feature = "arbitrary")]
17805 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17806 use arbitrary::{Arbitrary, Unstructured};
17807 let mut buf = [0u8; 1024];
17808 rng.fill_bytes(&mut buf);
17809 let mut unstructured = Unstructured::new(&buf);
17810 Self::arbitrary(&mut unstructured).unwrap_or_default()
17811 }
17812}
17813impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
17814 fn default() -> Self {
17815 Self::DEFAULT.clone()
17816 }
17817}
17818impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
17819 type Message = MavMessage;
17820 const ID: u32 = 332u32;
17821 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
17822 const EXTRA_CRC: u8 = 236u8;
17823 const ENCODED_LEN: usize = 239usize;
17824 fn deser(
17825 _version: MavlinkVersion,
17826 __input: &[u8],
17827 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17828 let avail_len = __input.len();
17829 let mut payload_buf = [0; Self::ENCODED_LEN];
17830 let mut buf = if avail_len < Self::ENCODED_LEN {
17831 payload_buf[0..avail_len].copy_from_slice(__input);
17832 Bytes::new(&payload_buf)
17833 } else {
17834 Bytes::new(__input)
17835 };
17836 let mut __struct = Self::default();
17837 __struct.time_usec = buf.get_u64_le();
17838 for v in &mut __struct.pos_x {
17839 let val = buf.get_f32_le();
17840 *v = val;
17841 }
17842 for v in &mut __struct.pos_y {
17843 let val = buf.get_f32_le();
17844 *v = val;
17845 }
17846 for v in &mut __struct.pos_z {
17847 let val = buf.get_f32_le();
17848 *v = val;
17849 }
17850 for v in &mut __struct.vel_x {
17851 let val = buf.get_f32_le();
17852 *v = val;
17853 }
17854 for v in &mut __struct.vel_y {
17855 let val = buf.get_f32_le();
17856 *v = val;
17857 }
17858 for v in &mut __struct.vel_z {
17859 let val = buf.get_f32_le();
17860 *v = val;
17861 }
17862 for v in &mut __struct.acc_x {
17863 let val = buf.get_f32_le();
17864 *v = val;
17865 }
17866 for v in &mut __struct.acc_y {
17867 let val = buf.get_f32_le();
17868 *v = val;
17869 }
17870 for v in &mut __struct.acc_z {
17871 let val = buf.get_f32_le();
17872 *v = val;
17873 }
17874 for v in &mut __struct.pos_yaw {
17875 let val = buf.get_f32_le();
17876 *v = val;
17877 }
17878 for v in &mut __struct.vel_yaw {
17879 let val = buf.get_f32_le();
17880 *v = val;
17881 }
17882 for v in &mut __struct.command {
17883 let val = buf.get_u16_le();
17884 *v = val;
17885 }
17886 __struct.valid_points = buf.get_u8();
17887 Ok(__struct)
17888 }
17889 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17890 let mut __tmp = BytesMut::new(bytes);
17891 #[allow(clippy::absurd_extreme_comparisons)]
17892 #[allow(unused_comparisons)]
17893 if __tmp.remaining() < Self::ENCODED_LEN {
17894 panic!(
17895 "buffer is too small (need {} bytes, but got {})",
17896 Self::ENCODED_LEN,
17897 __tmp.remaining(),
17898 )
17899 }
17900 __tmp.put_u64_le(self.time_usec);
17901 for val in &self.pos_x {
17902 __tmp.put_f32_le(*val);
17903 }
17904 for val in &self.pos_y {
17905 __tmp.put_f32_le(*val);
17906 }
17907 for val in &self.pos_z {
17908 __tmp.put_f32_le(*val);
17909 }
17910 for val in &self.vel_x {
17911 __tmp.put_f32_le(*val);
17912 }
17913 for val in &self.vel_y {
17914 __tmp.put_f32_le(*val);
17915 }
17916 for val in &self.vel_z {
17917 __tmp.put_f32_le(*val);
17918 }
17919 for val in &self.acc_x {
17920 __tmp.put_f32_le(*val);
17921 }
17922 for val in &self.acc_y {
17923 __tmp.put_f32_le(*val);
17924 }
17925 for val in &self.acc_z {
17926 __tmp.put_f32_le(*val);
17927 }
17928 for val in &self.pos_yaw {
17929 __tmp.put_f32_le(*val);
17930 }
17931 for val in &self.vel_yaw {
17932 __tmp.put_f32_le(*val);
17933 }
17934 for val in &self.command {
17935 __tmp.put_u16_le(*val);
17936 }
17937 __tmp.put_u8(self.valid_points);
17938 if matches!(version, MavlinkVersion::V2) {
17939 let len = __tmp.len();
17940 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17941 } else {
17942 __tmp.len()
17943 }
17944 }
17945}
17946#[doc = "id: 440"]
17947#[doc = "Illuminator status."]
17948#[derive(Debug, Clone, PartialEq)]
17949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17950#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17951pub struct ILLUMINATOR_STATUS_DATA {
17952 #[doc = "Time since the start-up of the illuminator in ms"]
17953 pub uptime_ms: u32,
17954 #[doc = "Errors"]
17955 pub error_status: IlluminatorErrorFlags,
17956 #[doc = "Illuminator brightness"]
17957 pub brightness: f32,
17958 #[doc = "Illuminator strobing period in seconds"]
17959 pub strobe_period: f32,
17960 #[doc = "Illuminator strobing duty cycle"]
17961 pub strobe_duty_cycle: f32,
17962 #[doc = "Temperature in Celsius"]
17963 pub temp_c: f32,
17964 #[doc = "Minimum strobing period in seconds"]
17965 pub min_strobe_period: f32,
17966 #[doc = "Maximum strobing period in seconds"]
17967 pub max_strobe_period: f32,
17968 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
17969 pub enable: u8,
17970 #[doc = "Supported illuminator modes"]
17971 pub mode_bitmask: IlluminatorMode,
17972 #[doc = "Illuminator mode"]
17973 pub mode: IlluminatorMode,
17974}
17975impl ILLUMINATOR_STATUS_DATA {
17976 pub const ENCODED_LEN: usize = 35usize;
17977 pub const DEFAULT: Self = Self {
17978 uptime_ms: 0_u32,
17979 error_status: IlluminatorErrorFlags::DEFAULT,
17980 brightness: 0.0_f32,
17981 strobe_period: 0.0_f32,
17982 strobe_duty_cycle: 0.0_f32,
17983 temp_c: 0.0_f32,
17984 min_strobe_period: 0.0_f32,
17985 max_strobe_period: 0.0_f32,
17986 enable: 0_u8,
17987 mode_bitmask: IlluminatorMode::DEFAULT,
17988 mode: IlluminatorMode::DEFAULT,
17989 };
17990 #[cfg(feature = "arbitrary")]
17991 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17992 use arbitrary::{Arbitrary, Unstructured};
17993 let mut buf = [0u8; 1024];
17994 rng.fill_bytes(&mut buf);
17995 let mut unstructured = Unstructured::new(&buf);
17996 Self::arbitrary(&mut unstructured).unwrap_or_default()
17997 }
17998}
17999impl Default for ILLUMINATOR_STATUS_DATA {
18000 fn default() -> Self {
18001 Self::DEFAULT.clone()
18002 }
18003}
18004impl MessageData for ILLUMINATOR_STATUS_DATA {
18005 type Message = MavMessage;
18006 const ID: u32 = 440u32;
18007 const NAME: &'static str = "ILLUMINATOR_STATUS";
18008 const EXTRA_CRC: u8 = 66u8;
18009 const ENCODED_LEN: usize = 35usize;
18010 fn deser(
18011 _version: MavlinkVersion,
18012 __input: &[u8],
18013 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18014 let avail_len = __input.len();
18015 let mut payload_buf = [0; Self::ENCODED_LEN];
18016 let mut buf = if avail_len < Self::ENCODED_LEN {
18017 payload_buf[0..avail_len].copy_from_slice(__input);
18018 Bytes::new(&payload_buf)
18019 } else {
18020 Bytes::new(__input)
18021 };
18022 let mut __struct = Self::default();
18023 __struct.uptime_ms = buf.get_u32_le();
18024 let tmp = buf.get_u32_le();
18025 __struct.error_status = IlluminatorErrorFlags::from_bits(
18026 tmp & IlluminatorErrorFlags::all().bits(),
18027 )
18028 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
18029 flag_type: "IlluminatorErrorFlags",
18030 value: tmp as u32,
18031 })?;
18032 __struct.brightness = buf.get_f32_le();
18033 __struct.strobe_period = buf.get_f32_le();
18034 __struct.strobe_duty_cycle = buf.get_f32_le();
18035 __struct.temp_c = buf.get_f32_le();
18036 __struct.min_strobe_period = buf.get_f32_le();
18037 __struct.max_strobe_period = buf.get_f32_le();
18038 __struct.enable = buf.get_u8();
18039 let tmp = buf.get_u8();
18040 __struct.mode_bitmask =
18041 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18042 enum_type: "IlluminatorMode",
18043 value: tmp as u32,
18044 })?;
18045 let tmp = buf.get_u8();
18046 __struct.mode =
18047 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18048 enum_type: "IlluminatorMode",
18049 value: tmp as u32,
18050 })?;
18051 Ok(__struct)
18052 }
18053 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18054 let mut __tmp = BytesMut::new(bytes);
18055 #[allow(clippy::absurd_extreme_comparisons)]
18056 #[allow(unused_comparisons)]
18057 if __tmp.remaining() < Self::ENCODED_LEN {
18058 panic!(
18059 "buffer is too small (need {} bytes, but got {})",
18060 Self::ENCODED_LEN,
18061 __tmp.remaining(),
18062 )
18063 }
18064 __tmp.put_u32_le(self.uptime_ms);
18065 __tmp.put_u32_le(self.error_status.bits());
18066 __tmp.put_f32_le(self.brightness);
18067 __tmp.put_f32_le(self.strobe_period);
18068 __tmp.put_f32_le(self.strobe_duty_cycle);
18069 __tmp.put_f32_le(self.temp_c);
18070 __tmp.put_f32_le(self.min_strobe_period);
18071 __tmp.put_f32_le(self.max_strobe_period);
18072 __tmp.put_u8(self.enable);
18073 __tmp.put_u8(self.mode_bitmask as u8);
18074 __tmp.put_u8(self.mode as u8);
18075 if matches!(version, MavlinkVersion::V2) {
18076 let len = __tmp.len();
18077 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18078 } else {
18079 __tmp.len()
18080 }
18081 }
18082}
18083#[doc = "id: 277"]
18084#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
18085#[derive(Debug, Clone, PartialEq)]
18086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18087#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18088pub struct CAMERA_THERMAL_RANGE_DATA {
18089 #[doc = "Timestamp (time since system boot)."]
18090 pub time_boot_ms: u32,
18091 #[doc = "Temperature max."]
18092 pub max: f32,
18093 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
18094 pub max_point_x: f32,
18095 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
18096 pub max_point_y: f32,
18097 #[doc = "Temperature min."]
18098 pub min: f32,
18099 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
18100 pub min_point_x: f32,
18101 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
18102 pub min_point_y: f32,
18103 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
18104 pub stream_id: u8,
18105 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
18106 pub camera_device_id: u8,
18107}
18108impl CAMERA_THERMAL_RANGE_DATA {
18109 pub const ENCODED_LEN: usize = 30usize;
18110 pub const DEFAULT: Self = Self {
18111 time_boot_ms: 0_u32,
18112 max: 0.0_f32,
18113 max_point_x: 0.0_f32,
18114 max_point_y: 0.0_f32,
18115 min: 0.0_f32,
18116 min_point_x: 0.0_f32,
18117 min_point_y: 0.0_f32,
18118 stream_id: 0_u8,
18119 camera_device_id: 0_u8,
18120 };
18121 #[cfg(feature = "arbitrary")]
18122 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18123 use arbitrary::{Arbitrary, Unstructured};
18124 let mut buf = [0u8; 1024];
18125 rng.fill_bytes(&mut buf);
18126 let mut unstructured = Unstructured::new(&buf);
18127 Self::arbitrary(&mut unstructured).unwrap_or_default()
18128 }
18129}
18130impl Default for CAMERA_THERMAL_RANGE_DATA {
18131 fn default() -> Self {
18132 Self::DEFAULT.clone()
18133 }
18134}
18135impl MessageData for CAMERA_THERMAL_RANGE_DATA {
18136 type Message = MavMessage;
18137 const ID: u32 = 277u32;
18138 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
18139 const EXTRA_CRC: u8 = 62u8;
18140 const ENCODED_LEN: usize = 30usize;
18141 fn deser(
18142 _version: MavlinkVersion,
18143 __input: &[u8],
18144 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18145 let avail_len = __input.len();
18146 let mut payload_buf = [0; Self::ENCODED_LEN];
18147 let mut buf = if avail_len < Self::ENCODED_LEN {
18148 payload_buf[0..avail_len].copy_from_slice(__input);
18149 Bytes::new(&payload_buf)
18150 } else {
18151 Bytes::new(__input)
18152 };
18153 let mut __struct = Self::default();
18154 __struct.time_boot_ms = buf.get_u32_le();
18155 __struct.max = buf.get_f32_le();
18156 __struct.max_point_x = buf.get_f32_le();
18157 __struct.max_point_y = buf.get_f32_le();
18158 __struct.min = buf.get_f32_le();
18159 __struct.min_point_x = buf.get_f32_le();
18160 __struct.min_point_y = buf.get_f32_le();
18161 __struct.stream_id = buf.get_u8();
18162 __struct.camera_device_id = buf.get_u8();
18163 Ok(__struct)
18164 }
18165 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18166 let mut __tmp = BytesMut::new(bytes);
18167 #[allow(clippy::absurd_extreme_comparisons)]
18168 #[allow(unused_comparisons)]
18169 if __tmp.remaining() < Self::ENCODED_LEN {
18170 panic!(
18171 "buffer is too small (need {} bytes, but got {})",
18172 Self::ENCODED_LEN,
18173 __tmp.remaining(),
18174 )
18175 }
18176 __tmp.put_u32_le(self.time_boot_ms);
18177 __tmp.put_f32_le(self.max);
18178 __tmp.put_f32_le(self.max_point_x);
18179 __tmp.put_f32_le(self.max_point_y);
18180 __tmp.put_f32_le(self.min);
18181 __tmp.put_f32_le(self.min_point_x);
18182 __tmp.put_f32_le(self.min_point_y);
18183 __tmp.put_u8(self.stream_id);
18184 __tmp.put_u8(self.camera_device_id);
18185 if matches!(version, MavlinkVersion::V2) {
18186 let len = __tmp.len();
18187 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18188 } else {
18189 __tmp.len()
18190 }
18191 }
18192}
18193#[doc = "id: 288"]
18194#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
18195#[derive(Debug, Clone, PartialEq)]
18196#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18197#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18198pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
18199 #[doc = "High level gimbal manager flags."]
18200 pub flags: GimbalManagerFlags,
18201 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
18202 pub pitch: f32,
18203 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
18204 pub yaw: f32,
18205 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
18206 pub pitch_rate: f32,
18207 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
18208 pub yaw_rate: f32,
18209 #[doc = "System ID"]
18210 pub target_system: u8,
18211 #[doc = "Component ID"]
18212 pub target_component: u8,
18213 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
18214 pub gimbal_device_id: u8,
18215}
18216impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
18217 pub const ENCODED_LEN: usize = 23usize;
18218 pub const DEFAULT: Self = Self {
18219 flags: GimbalManagerFlags::DEFAULT,
18220 pitch: 0.0_f32,
18221 yaw: 0.0_f32,
18222 pitch_rate: 0.0_f32,
18223 yaw_rate: 0.0_f32,
18224 target_system: 0_u8,
18225 target_component: 0_u8,
18226 gimbal_device_id: 0_u8,
18227 };
18228 #[cfg(feature = "arbitrary")]
18229 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18230 use arbitrary::{Arbitrary, Unstructured};
18231 let mut buf = [0u8; 1024];
18232 rng.fill_bytes(&mut buf);
18233 let mut unstructured = Unstructured::new(&buf);
18234 Self::arbitrary(&mut unstructured).unwrap_or_default()
18235 }
18236}
18237impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
18238 fn default() -> Self {
18239 Self::DEFAULT.clone()
18240 }
18241}
18242impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
18243 type Message = MavMessage;
18244 const ID: u32 = 288u32;
18245 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
18246 const EXTRA_CRC: u8 = 20u8;
18247 const ENCODED_LEN: usize = 23usize;
18248 fn deser(
18249 _version: MavlinkVersion,
18250 __input: &[u8],
18251 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18252 let avail_len = __input.len();
18253 let mut payload_buf = [0; Self::ENCODED_LEN];
18254 let mut buf = if avail_len < Self::ENCODED_LEN {
18255 payload_buf[0..avail_len].copy_from_slice(__input);
18256 Bytes::new(&payload_buf)
18257 } else {
18258 Bytes::new(__input)
18259 };
18260 let mut __struct = Self::default();
18261 let tmp = buf.get_u32_le();
18262 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
18263 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
18264 flag_type: "GimbalManagerFlags",
18265 value: tmp as u32,
18266 })?;
18267 __struct.pitch = buf.get_f32_le();
18268 __struct.yaw = buf.get_f32_le();
18269 __struct.pitch_rate = buf.get_f32_le();
18270 __struct.yaw_rate = buf.get_f32_le();
18271 __struct.target_system = buf.get_u8();
18272 __struct.target_component = buf.get_u8();
18273 __struct.gimbal_device_id = buf.get_u8();
18274 Ok(__struct)
18275 }
18276 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18277 let mut __tmp = BytesMut::new(bytes);
18278 #[allow(clippy::absurd_extreme_comparisons)]
18279 #[allow(unused_comparisons)]
18280 if __tmp.remaining() < Self::ENCODED_LEN {
18281 panic!(
18282 "buffer is too small (need {} bytes, but got {})",
18283 Self::ENCODED_LEN,
18284 __tmp.remaining(),
18285 )
18286 }
18287 __tmp.put_u32_le(self.flags.bits());
18288 __tmp.put_f32_le(self.pitch);
18289 __tmp.put_f32_le(self.yaw);
18290 __tmp.put_f32_le(self.pitch_rate);
18291 __tmp.put_f32_le(self.yaw_rate);
18292 __tmp.put_u8(self.target_system);
18293 __tmp.put_u8(self.target_component);
18294 __tmp.put_u8(self.gimbal_device_id);
18295 if matches!(version, MavlinkVersion::V2) {
18296 let len = __tmp.len();
18297 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18298 } else {
18299 __tmp.len()
18300 }
18301 }
18302}
18303#[doc = "id: 268"]
18304#[doc = "An ack for a LOGGING_DATA_ACKED message."]
18305#[derive(Debug, Clone, PartialEq)]
18306#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18307#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18308pub struct LOGGING_ACK_DATA {
18309 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
18310 pub sequence: u16,
18311 #[doc = "system ID of the target"]
18312 pub target_system: u8,
18313 #[doc = "component ID of the target"]
18314 pub target_component: u8,
18315}
18316impl LOGGING_ACK_DATA {
18317 pub const ENCODED_LEN: usize = 4usize;
18318 pub const DEFAULT: Self = Self {
18319 sequence: 0_u16,
18320 target_system: 0_u8,
18321 target_component: 0_u8,
18322 };
18323 #[cfg(feature = "arbitrary")]
18324 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18325 use arbitrary::{Arbitrary, Unstructured};
18326 let mut buf = [0u8; 1024];
18327 rng.fill_bytes(&mut buf);
18328 let mut unstructured = Unstructured::new(&buf);
18329 Self::arbitrary(&mut unstructured).unwrap_or_default()
18330 }
18331}
18332impl Default for LOGGING_ACK_DATA {
18333 fn default() -> Self {
18334 Self::DEFAULT.clone()
18335 }
18336}
18337impl MessageData for LOGGING_ACK_DATA {
18338 type Message = MavMessage;
18339 const ID: u32 = 268u32;
18340 const NAME: &'static str = "LOGGING_ACK";
18341 const EXTRA_CRC: u8 = 14u8;
18342 const ENCODED_LEN: usize = 4usize;
18343 fn deser(
18344 _version: MavlinkVersion,
18345 __input: &[u8],
18346 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18347 let avail_len = __input.len();
18348 let mut payload_buf = [0; Self::ENCODED_LEN];
18349 let mut buf = if avail_len < Self::ENCODED_LEN {
18350 payload_buf[0..avail_len].copy_from_slice(__input);
18351 Bytes::new(&payload_buf)
18352 } else {
18353 Bytes::new(__input)
18354 };
18355 let mut __struct = Self::default();
18356 __struct.sequence = buf.get_u16_le();
18357 __struct.target_system = buf.get_u8();
18358 __struct.target_component = buf.get_u8();
18359 Ok(__struct)
18360 }
18361 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18362 let mut __tmp = BytesMut::new(bytes);
18363 #[allow(clippy::absurd_extreme_comparisons)]
18364 #[allow(unused_comparisons)]
18365 if __tmp.remaining() < Self::ENCODED_LEN {
18366 panic!(
18367 "buffer is too small (need {} bytes, but got {})",
18368 Self::ENCODED_LEN,
18369 __tmp.remaining(),
18370 )
18371 }
18372 __tmp.put_u16_le(self.sequence);
18373 __tmp.put_u8(self.target_system);
18374 __tmp.put_u8(self.target_component);
18375 if matches!(version, MavlinkVersion::V2) {
18376 let len = __tmp.len();
18377 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18378 } else {
18379 __tmp.len()
18380 }
18381 }
18382}
18383#[doc = "id: 271"]
18384#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
18385#[derive(Debug, Clone, PartialEq)]
18386#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18387#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18388pub struct CAMERA_FOV_STATUS_DATA {
18389 #[doc = "Timestamp (time since system boot)."]
18390 pub time_boot_ms: u32,
18391 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
18392 pub lat_camera: i32,
18393 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
18394 pub lon_camera: i32,
18395 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
18396 pub alt_camera: i32,
18397 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
18398 pub lat_image: i32,
18399 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
18400 pub lon_image: i32,
18401 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
18402 pub alt_image: i32,
18403 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
18404 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18405 pub q: [f32; 4],
18406 #[doc = "Horizontal field of view (NaN if unknown)."]
18407 pub hfov: f32,
18408 #[doc = "Vertical field of view (NaN if unknown)."]
18409 pub vfov: f32,
18410 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
18411 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18412 pub camera_device_id: u8,
18413}
18414impl CAMERA_FOV_STATUS_DATA {
18415 pub const ENCODED_LEN: usize = 53usize;
18416 pub const DEFAULT: Self = Self {
18417 time_boot_ms: 0_u32,
18418 lat_camera: 0_i32,
18419 lon_camera: 0_i32,
18420 alt_camera: 0_i32,
18421 lat_image: 0_i32,
18422 lon_image: 0_i32,
18423 alt_image: 0_i32,
18424 q: [0.0_f32; 4usize],
18425 hfov: 0.0_f32,
18426 vfov: 0.0_f32,
18427 camera_device_id: 0_u8,
18428 };
18429 #[cfg(feature = "arbitrary")]
18430 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18431 use arbitrary::{Arbitrary, Unstructured};
18432 let mut buf = [0u8; 1024];
18433 rng.fill_bytes(&mut buf);
18434 let mut unstructured = Unstructured::new(&buf);
18435 Self::arbitrary(&mut unstructured).unwrap_or_default()
18436 }
18437}
18438impl Default for CAMERA_FOV_STATUS_DATA {
18439 fn default() -> Self {
18440 Self::DEFAULT.clone()
18441 }
18442}
18443impl MessageData for CAMERA_FOV_STATUS_DATA {
18444 type Message = MavMessage;
18445 const ID: u32 = 271u32;
18446 const NAME: &'static str = "CAMERA_FOV_STATUS";
18447 const EXTRA_CRC: u8 = 22u8;
18448 const ENCODED_LEN: usize = 53usize;
18449 fn deser(
18450 _version: MavlinkVersion,
18451 __input: &[u8],
18452 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18453 let avail_len = __input.len();
18454 let mut payload_buf = [0; Self::ENCODED_LEN];
18455 let mut buf = if avail_len < Self::ENCODED_LEN {
18456 payload_buf[0..avail_len].copy_from_slice(__input);
18457 Bytes::new(&payload_buf)
18458 } else {
18459 Bytes::new(__input)
18460 };
18461 let mut __struct = Self::default();
18462 __struct.time_boot_ms = buf.get_u32_le();
18463 __struct.lat_camera = buf.get_i32_le();
18464 __struct.lon_camera = buf.get_i32_le();
18465 __struct.alt_camera = buf.get_i32_le();
18466 __struct.lat_image = buf.get_i32_le();
18467 __struct.lon_image = buf.get_i32_le();
18468 __struct.alt_image = buf.get_i32_le();
18469 for v in &mut __struct.q {
18470 let val = buf.get_f32_le();
18471 *v = val;
18472 }
18473 __struct.hfov = buf.get_f32_le();
18474 __struct.vfov = buf.get_f32_le();
18475 __struct.camera_device_id = buf.get_u8();
18476 Ok(__struct)
18477 }
18478 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18479 let mut __tmp = BytesMut::new(bytes);
18480 #[allow(clippy::absurd_extreme_comparisons)]
18481 #[allow(unused_comparisons)]
18482 if __tmp.remaining() < Self::ENCODED_LEN {
18483 panic!(
18484 "buffer is too small (need {} bytes, but got {})",
18485 Self::ENCODED_LEN,
18486 __tmp.remaining(),
18487 )
18488 }
18489 __tmp.put_u32_le(self.time_boot_ms);
18490 __tmp.put_i32_le(self.lat_camera);
18491 __tmp.put_i32_le(self.lon_camera);
18492 __tmp.put_i32_le(self.alt_camera);
18493 __tmp.put_i32_le(self.lat_image);
18494 __tmp.put_i32_le(self.lon_image);
18495 __tmp.put_i32_le(self.alt_image);
18496 for val in &self.q {
18497 __tmp.put_f32_le(*val);
18498 }
18499 __tmp.put_f32_le(self.hfov);
18500 __tmp.put_f32_le(self.vfov);
18501 __tmp.put_u8(self.camera_device_id);
18502 if matches!(version, MavlinkVersion::V2) {
18503 let len = __tmp.len();
18504 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18505 } else {
18506 __tmp.len()
18507 }
18508 }
18509}
18510#[doc = "id: 413"]
18511#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
18512#[derive(Debug, Clone, PartialEq)]
18513#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18515pub struct RESPONSE_EVENT_ERROR_DATA {
18516 #[doc = "Sequence number."]
18517 pub sequence: u16,
18518 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
18519 pub sequence_oldest_available: u16,
18520 #[doc = "System ID"]
18521 pub target_system: u8,
18522 #[doc = "Component ID"]
18523 pub target_component: u8,
18524 #[doc = "Error reason."]
18525 pub reason: MavEventErrorReason,
18526}
18527impl RESPONSE_EVENT_ERROR_DATA {
18528 pub const ENCODED_LEN: usize = 7usize;
18529 pub const DEFAULT: Self = Self {
18530 sequence: 0_u16,
18531 sequence_oldest_available: 0_u16,
18532 target_system: 0_u8,
18533 target_component: 0_u8,
18534 reason: MavEventErrorReason::DEFAULT,
18535 };
18536 #[cfg(feature = "arbitrary")]
18537 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18538 use arbitrary::{Arbitrary, Unstructured};
18539 let mut buf = [0u8; 1024];
18540 rng.fill_bytes(&mut buf);
18541 let mut unstructured = Unstructured::new(&buf);
18542 Self::arbitrary(&mut unstructured).unwrap_or_default()
18543 }
18544}
18545impl Default for RESPONSE_EVENT_ERROR_DATA {
18546 fn default() -> Self {
18547 Self::DEFAULT.clone()
18548 }
18549}
18550impl MessageData for RESPONSE_EVENT_ERROR_DATA {
18551 type Message = MavMessage;
18552 const ID: u32 = 413u32;
18553 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
18554 const EXTRA_CRC: u8 = 77u8;
18555 const ENCODED_LEN: usize = 7usize;
18556 fn deser(
18557 _version: MavlinkVersion,
18558 __input: &[u8],
18559 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18560 let avail_len = __input.len();
18561 let mut payload_buf = [0; Self::ENCODED_LEN];
18562 let mut buf = if avail_len < Self::ENCODED_LEN {
18563 payload_buf[0..avail_len].copy_from_slice(__input);
18564 Bytes::new(&payload_buf)
18565 } else {
18566 Bytes::new(__input)
18567 };
18568 let mut __struct = Self::default();
18569 __struct.sequence = buf.get_u16_le();
18570 __struct.sequence_oldest_available = buf.get_u16_le();
18571 __struct.target_system = buf.get_u8();
18572 __struct.target_component = buf.get_u8();
18573 let tmp = buf.get_u8();
18574 __struct.reason =
18575 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18576 enum_type: "MavEventErrorReason",
18577 value: tmp as u32,
18578 })?;
18579 Ok(__struct)
18580 }
18581 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18582 let mut __tmp = BytesMut::new(bytes);
18583 #[allow(clippy::absurd_extreme_comparisons)]
18584 #[allow(unused_comparisons)]
18585 if __tmp.remaining() < Self::ENCODED_LEN {
18586 panic!(
18587 "buffer is too small (need {} bytes, but got {})",
18588 Self::ENCODED_LEN,
18589 __tmp.remaining(),
18590 )
18591 }
18592 __tmp.put_u16_le(self.sequence);
18593 __tmp.put_u16_le(self.sequence_oldest_available);
18594 __tmp.put_u8(self.target_system);
18595 __tmp.put_u8(self.target_component);
18596 __tmp.put_u8(self.reason as u8);
18597 if matches!(version, MavlinkVersion::V2) {
18598 let len = __tmp.len();
18599 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18600 } else {
18601 __tmp.len()
18602 }
18603 }
18604}
18605#[doc = "id: 437"]
18606#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
18607#[derive(Debug, Clone, PartialEq)]
18608#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18609#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18610pub struct AVAILABLE_MODES_MONITOR_DATA {
18611 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
18612 pub seq: u8,
18613}
18614impl AVAILABLE_MODES_MONITOR_DATA {
18615 pub const ENCODED_LEN: usize = 1usize;
18616 pub const DEFAULT: Self = Self { seq: 0_u8 };
18617 #[cfg(feature = "arbitrary")]
18618 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18619 use arbitrary::{Arbitrary, Unstructured};
18620 let mut buf = [0u8; 1024];
18621 rng.fill_bytes(&mut buf);
18622 let mut unstructured = Unstructured::new(&buf);
18623 Self::arbitrary(&mut unstructured).unwrap_or_default()
18624 }
18625}
18626impl Default for AVAILABLE_MODES_MONITOR_DATA {
18627 fn default() -> Self {
18628 Self::DEFAULT.clone()
18629 }
18630}
18631impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
18632 type Message = MavMessage;
18633 const ID: u32 = 437u32;
18634 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
18635 const EXTRA_CRC: u8 = 30u8;
18636 const ENCODED_LEN: usize = 1usize;
18637 fn deser(
18638 _version: MavlinkVersion,
18639 __input: &[u8],
18640 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18641 let avail_len = __input.len();
18642 let mut payload_buf = [0; Self::ENCODED_LEN];
18643 let mut buf = if avail_len < Self::ENCODED_LEN {
18644 payload_buf[0..avail_len].copy_from_slice(__input);
18645 Bytes::new(&payload_buf)
18646 } else {
18647 Bytes::new(__input)
18648 };
18649 let mut __struct = Self::default();
18650 __struct.seq = buf.get_u8();
18651 Ok(__struct)
18652 }
18653 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18654 let mut __tmp = BytesMut::new(bytes);
18655 #[allow(clippy::absurd_extreme_comparisons)]
18656 #[allow(unused_comparisons)]
18657 if __tmp.remaining() < Self::ENCODED_LEN {
18658 panic!(
18659 "buffer is too small (need {} bytes, but got {})",
18660 Self::ENCODED_LEN,
18661 __tmp.remaining(),
18662 )
18663 }
18664 __tmp.put_u8(self.seq);
18665 if matches!(version, MavlinkVersion::V2) {
18666 let len = __tmp.len();
18667 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18668 } else {
18669 __tmp.len()
18670 }
18671 }
18672}
18673#[doc = "id: 113"]
18674#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
18675#[derive(Debug, Clone, PartialEq)]
18676#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18677#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18678pub struct HIL_GPS_DATA {
18679 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18680 pub time_usec: u64,
18681 #[doc = "Latitude (WGS84)"]
18682 pub lat: i32,
18683 #[doc = "Longitude (WGS84)"]
18684 pub lon: i32,
18685 #[doc = "Altitude (MSL). Positive for up."]
18686 pub alt: i32,
18687 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
18688 pub eph: u16,
18689 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
18690 pub epv: u16,
18691 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
18692 pub vel: u16,
18693 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
18694 pub vn: i16,
18695 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
18696 pub ve: i16,
18697 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
18698 pub vd: i16,
18699 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
18700 pub cog: u16,
18701 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
18702 pub fix_type: u8,
18703 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
18704 pub satellites_visible: u8,
18705 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
18706 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18707 pub id: u8,
18708 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
18709 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18710 pub yaw: u16,
18711}
18712impl HIL_GPS_DATA {
18713 pub const ENCODED_LEN: usize = 39usize;
18714 pub const DEFAULT: Self = Self {
18715 time_usec: 0_u64,
18716 lat: 0_i32,
18717 lon: 0_i32,
18718 alt: 0_i32,
18719 eph: 0_u16,
18720 epv: 0_u16,
18721 vel: 0_u16,
18722 vn: 0_i16,
18723 ve: 0_i16,
18724 vd: 0_i16,
18725 cog: 0_u16,
18726 fix_type: 0_u8,
18727 satellites_visible: 0_u8,
18728 id: 0_u8,
18729 yaw: 0_u16,
18730 };
18731 #[cfg(feature = "arbitrary")]
18732 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18733 use arbitrary::{Arbitrary, Unstructured};
18734 let mut buf = [0u8; 1024];
18735 rng.fill_bytes(&mut buf);
18736 let mut unstructured = Unstructured::new(&buf);
18737 Self::arbitrary(&mut unstructured).unwrap_or_default()
18738 }
18739}
18740impl Default for HIL_GPS_DATA {
18741 fn default() -> Self {
18742 Self::DEFAULT.clone()
18743 }
18744}
18745impl MessageData for HIL_GPS_DATA {
18746 type Message = MavMessage;
18747 const ID: u32 = 113u32;
18748 const NAME: &'static str = "HIL_GPS";
18749 const EXTRA_CRC: u8 = 124u8;
18750 const ENCODED_LEN: usize = 39usize;
18751 fn deser(
18752 _version: MavlinkVersion,
18753 __input: &[u8],
18754 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18755 let avail_len = __input.len();
18756 let mut payload_buf = [0; Self::ENCODED_LEN];
18757 let mut buf = if avail_len < Self::ENCODED_LEN {
18758 payload_buf[0..avail_len].copy_from_slice(__input);
18759 Bytes::new(&payload_buf)
18760 } else {
18761 Bytes::new(__input)
18762 };
18763 let mut __struct = Self::default();
18764 __struct.time_usec = buf.get_u64_le();
18765 __struct.lat = buf.get_i32_le();
18766 __struct.lon = buf.get_i32_le();
18767 __struct.alt = buf.get_i32_le();
18768 __struct.eph = buf.get_u16_le();
18769 __struct.epv = buf.get_u16_le();
18770 __struct.vel = buf.get_u16_le();
18771 __struct.vn = buf.get_i16_le();
18772 __struct.ve = buf.get_i16_le();
18773 __struct.vd = buf.get_i16_le();
18774 __struct.cog = buf.get_u16_le();
18775 __struct.fix_type = buf.get_u8();
18776 __struct.satellites_visible = buf.get_u8();
18777 __struct.id = buf.get_u8();
18778 __struct.yaw = buf.get_u16_le();
18779 Ok(__struct)
18780 }
18781 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18782 let mut __tmp = BytesMut::new(bytes);
18783 #[allow(clippy::absurd_extreme_comparisons)]
18784 #[allow(unused_comparisons)]
18785 if __tmp.remaining() < Self::ENCODED_LEN {
18786 panic!(
18787 "buffer is too small (need {} bytes, but got {})",
18788 Self::ENCODED_LEN,
18789 __tmp.remaining(),
18790 )
18791 }
18792 __tmp.put_u64_le(self.time_usec);
18793 __tmp.put_i32_le(self.lat);
18794 __tmp.put_i32_le(self.lon);
18795 __tmp.put_i32_le(self.alt);
18796 __tmp.put_u16_le(self.eph);
18797 __tmp.put_u16_le(self.epv);
18798 __tmp.put_u16_le(self.vel);
18799 __tmp.put_i16_le(self.vn);
18800 __tmp.put_i16_le(self.ve);
18801 __tmp.put_i16_le(self.vd);
18802 __tmp.put_u16_le(self.cog);
18803 __tmp.put_u8(self.fix_type);
18804 __tmp.put_u8(self.satellites_visible);
18805 __tmp.put_u8(self.id);
18806 __tmp.put_u16_le(self.yaw);
18807 if matches!(version, MavlinkVersion::V2) {
18808 let len = __tmp.len();
18809 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18810 } else {
18811 __tmp.len()
18812 }
18813 }
18814}
18815#[doc = "id: 141"]
18816#[doc = "The current system altitude."]
18817#[derive(Debug, Clone, PartialEq)]
18818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18819#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18820pub struct ALTITUDE_DATA {
18821 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
18822 pub time_usec: u64,
18823 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
18824 pub altitude_monotonic: f32,
18825 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
18826 pub altitude_amsl: f32,
18827 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
18828 pub altitude_local: f32,
18829 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
18830 pub altitude_relative: f32,
18831 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
18832 pub altitude_terrain: f32,
18833 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
18834 pub bottom_clearance: f32,
18835}
18836impl ALTITUDE_DATA {
18837 pub const ENCODED_LEN: usize = 32usize;
18838 pub const DEFAULT: Self = Self {
18839 time_usec: 0_u64,
18840 altitude_monotonic: 0.0_f32,
18841 altitude_amsl: 0.0_f32,
18842 altitude_local: 0.0_f32,
18843 altitude_relative: 0.0_f32,
18844 altitude_terrain: 0.0_f32,
18845 bottom_clearance: 0.0_f32,
18846 };
18847 #[cfg(feature = "arbitrary")]
18848 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18849 use arbitrary::{Arbitrary, Unstructured};
18850 let mut buf = [0u8; 1024];
18851 rng.fill_bytes(&mut buf);
18852 let mut unstructured = Unstructured::new(&buf);
18853 Self::arbitrary(&mut unstructured).unwrap_or_default()
18854 }
18855}
18856impl Default for ALTITUDE_DATA {
18857 fn default() -> Self {
18858 Self::DEFAULT.clone()
18859 }
18860}
18861impl MessageData for ALTITUDE_DATA {
18862 type Message = MavMessage;
18863 const ID: u32 = 141u32;
18864 const NAME: &'static str = "ALTITUDE";
18865 const EXTRA_CRC: u8 = 47u8;
18866 const ENCODED_LEN: usize = 32usize;
18867 fn deser(
18868 _version: MavlinkVersion,
18869 __input: &[u8],
18870 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18871 let avail_len = __input.len();
18872 let mut payload_buf = [0; Self::ENCODED_LEN];
18873 let mut buf = if avail_len < Self::ENCODED_LEN {
18874 payload_buf[0..avail_len].copy_from_slice(__input);
18875 Bytes::new(&payload_buf)
18876 } else {
18877 Bytes::new(__input)
18878 };
18879 let mut __struct = Self::default();
18880 __struct.time_usec = buf.get_u64_le();
18881 __struct.altitude_monotonic = buf.get_f32_le();
18882 __struct.altitude_amsl = buf.get_f32_le();
18883 __struct.altitude_local = buf.get_f32_le();
18884 __struct.altitude_relative = buf.get_f32_le();
18885 __struct.altitude_terrain = buf.get_f32_le();
18886 __struct.bottom_clearance = buf.get_f32_le();
18887 Ok(__struct)
18888 }
18889 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18890 let mut __tmp = BytesMut::new(bytes);
18891 #[allow(clippy::absurd_extreme_comparisons)]
18892 #[allow(unused_comparisons)]
18893 if __tmp.remaining() < Self::ENCODED_LEN {
18894 panic!(
18895 "buffer is too small (need {} bytes, but got {})",
18896 Self::ENCODED_LEN,
18897 __tmp.remaining(),
18898 )
18899 }
18900 __tmp.put_u64_le(self.time_usec);
18901 __tmp.put_f32_le(self.altitude_monotonic);
18902 __tmp.put_f32_le(self.altitude_amsl);
18903 __tmp.put_f32_le(self.altitude_local);
18904 __tmp.put_f32_le(self.altitude_relative);
18905 __tmp.put_f32_le(self.altitude_terrain);
18906 __tmp.put_f32_le(self.bottom_clearance);
18907 if matches!(version, MavlinkVersion::V2) {
18908 let len = __tmp.len();
18909 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18910 } else {
18911 __tmp.len()
18912 }
18913 }
18914}
18915#[doc = "id: 60053"]
18916#[doc = "Drone operation mode."]
18917#[derive(Debug, Clone, PartialEq)]
18918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18919#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18920pub struct AVSS_DRONE_OPERATION_MODE_DATA {
18921 #[doc = "Timestamp (time since FC boot)."]
18922 pub time_boot_ms: u32,
18923 #[doc = "DJI M300 operation mode"]
18924 pub M300_operation_mode: u8,
18925 #[doc = "horsefly operation mode"]
18926 pub horsefly_operation_mode: u8,
18927}
18928impl AVSS_DRONE_OPERATION_MODE_DATA {
18929 pub const ENCODED_LEN: usize = 6usize;
18930 pub const DEFAULT: Self = Self {
18931 time_boot_ms: 0_u32,
18932 M300_operation_mode: 0_u8,
18933 horsefly_operation_mode: 0_u8,
18934 };
18935 #[cfg(feature = "arbitrary")]
18936 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18937 use arbitrary::{Arbitrary, Unstructured};
18938 let mut buf = [0u8; 1024];
18939 rng.fill_bytes(&mut buf);
18940 let mut unstructured = Unstructured::new(&buf);
18941 Self::arbitrary(&mut unstructured).unwrap_or_default()
18942 }
18943}
18944impl Default for AVSS_DRONE_OPERATION_MODE_DATA {
18945 fn default() -> Self {
18946 Self::DEFAULT.clone()
18947 }
18948}
18949impl MessageData for AVSS_DRONE_OPERATION_MODE_DATA {
18950 type Message = MavMessage;
18951 const ID: u32 = 60053u32;
18952 const NAME: &'static str = "AVSS_DRONE_OPERATION_MODE";
18953 const EXTRA_CRC: u8 = 45u8;
18954 const ENCODED_LEN: usize = 6usize;
18955 fn deser(
18956 _version: MavlinkVersion,
18957 __input: &[u8],
18958 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18959 let avail_len = __input.len();
18960 let mut payload_buf = [0; Self::ENCODED_LEN];
18961 let mut buf = if avail_len < Self::ENCODED_LEN {
18962 payload_buf[0..avail_len].copy_from_slice(__input);
18963 Bytes::new(&payload_buf)
18964 } else {
18965 Bytes::new(__input)
18966 };
18967 let mut __struct = Self::default();
18968 __struct.time_boot_ms = buf.get_u32_le();
18969 __struct.M300_operation_mode = buf.get_u8();
18970 __struct.horsefly_operation_mode = buf.get_u8();
18971 Ok(__struct)
18972 }
18973 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18974 let mut __tmp = BytesMut::new(bytes);
18975 #[allow(clippy::absurd_extreme_comparisons)]
18976 #[allow(unused_comparisons)]
18977 if __tmp.remaining() < Self::ENCODED_LEN {
18978 panic!(
18979 "buffer is too small (need {} bytes, but got {})",
18980 Self::ENCODED_LEN,
18981 __tmp.remaining(),
18982 )
18983 }
18984 __tmp.put_u32_le(self.time_boot_ms);
18985 __tmp.put_u8(self.M300_operation_mode);
18986 __tmp.put_u8(self.horsefly_operation_mode);
18987 if matches!(version, MavlinkVersion::V2) {
18988 let len = __tmp.len();
18989 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18990 } else {
18991 __tmp.len()
18992 }
18993 }
18994}
18995#[doc = "id: 112"]
18996#[doc = "Camera-IMU triggering and synchronisation message."]
18997#[derive(Debug, Clone, PartialEq)]
18998#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18999#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19000pub struct CAMERA_TRIGGER_DATA {
19001 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
19002 pub time_usec: u64,
19003 #[doc = "Image frame sequence"]
19004 pub seq: u32,
19005}
19006impl CAMERA_TRIGGER_DATA {
19007 pub const ENCODED_LEN: usize = 12usize;
19008 pub const DEFAULT: Self = Self {
19009 time_usec: 0_u64,
19010 seq: 0_u32,
19011 };
19012 #[cfg(feature = "arbitrary")]
19013 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19014 use arbitrary::{Arbitrary, Unstructured};
19015 let mut buf = [0u8; 1024];
19016 rng.fill_bytes(&mut buf);
19017 let mut unstructured = Unstructured::new(&buf);
19018 Self::arbitrary(&mut unstructured).unwrap_or_default()
19019 }
19020}
19021impl Default for CAMERA_TRIGGER_DATA {
19022 fn default() -> Self {
19023 Self::DEFAULT.clone()
19024 }
19025}
19026impl MessageData for CAMERA_TRIGGER_DATA {
19027 type Message = MavMessage;
19028 const ID: u32 = 112u32;
19029 const NAME: &'static str = "CAMERA_TRIGGER";
19030 const EXTRA_CRC: u8 = 174u8;
19031 const ENCODED_LEN: usize = 12usize;
19032 fn deser(
19033 _version: MavlinkVersion,
19034 __input: &[u8],
19035 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19036 let avail_len = __input.len();
19037 let mut payload_buf = [0; Self::ENCODED_LEN];
19038 let mut buf = if avail_len < Self::ENCODED_LEN {
19039 payload_buf[0..avail_len].copy_from_slice(__input);
19040 Bytes::new(&payload_buf)
19041 } else {
19042 Bytes::new(__input)
19043 };
19044 let mut __struct = Self::default();
19045 __struct.time_usec = buf.get_u64_le();
19046 __struct.seq = buf.get_u32_le();
19047 Ok(__struct)
19048 }
19049 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19050 let mut __tmp = BytesMut::new(bytes);
19051 #[allow(clippy::absurd_extreme_comparisons)]
19052 #[allow(unused_comparisons)]
19053 if __tmp.remaining() < Self::ENCODED_LEN {
19054 panic!(
19055 "buffer is too small (need {} bytes, but got {})",
19056 Self::ENCODED_LEN,
19057 __tmp.remaining(),
19058 )
19059 }
19060 __tmp.put_u64_le(self.time_usec);
19061 __tmp.put_u32_le(self.seq);
19062 if matches!(version, MavlinkVersion::V2) {
19063 let len = __tmp.len();
19064 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19065 } else {
19066 __tmp.len()
19067 }
19068 }
19069}
19070#[doc = "id: 33"]
19071#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
19072#[derive(Debug, Clone, PartialEq)]
19073#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19074#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19075pub struct GLOBAL_POSITION_INT_DATA {
19076 #[doc = "Timestamp (time since system boot)."]
19077 pub time_boot_ms: u32,
19078 #[doc = "Latitude, expressed"]
19079 pub lat: i32,
19080 #[doc = "Longitude, expressed"]
19081 pub lon: i32,
19082 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
19083 pub alt: i32,
19084 #[doc = "Altitude above home"]
19085 pub relative_alt: i32,
19086 #[doc = "Ground X Speed (Latitude, positive north)"]
19087 pub vx: i16,
19088 #[doc = "Ground Y Speed (Longitude, positive east)"]
19089 pub vy: i16,
19090 #[doc = "Ground Z Speed (Altitude, positive down)"]
19091 pub vz: i16,
19092 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
19093 pub hdg: u16,
19094}
19095impl GLOBAL_POSITION_INT_DATA {
19096 pub const ENCODED_LEN: usize = 28usize;
19097 pub const DEFAULT: Self = Self {
19098 time_boot_ms: 0_u32,
19099 lat: 0_i32,
19100 lon: 0_i32,
19101 alt: 0_i32,
19102 relative_alt: 0_i32,
19103 vx: 0_i16,
19104 vy: 0_i16,
19105 vz: 0_i16,
19106 hdg: 0_u16,
19107 };
19108 #[cfg(feature = "arbitrary")]
19109 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19110 use arbitrary::{Arbitrary, Unstructured};
19111 let mut buf = [0u8; 1024];
19112 rng.fill_bytes(&mut buf);
19113 let mut unstructured = Unstructured::new(&buf);
19114 Self::arbitrary(&mut unstructured).unwrap_or_default()
19115 }
19116}
19117impl Default for GLOBAL_POSITION_INT_DATA {
19118 fn default() -> Self {
19119 Self::DEFAULT.clone()
19120 }
19121}
19122impl MessageData for GLOBAL_POSITION_INT_DATA {
19123 type Message = MavMessage;
19124 const ID: u32 = 33u32;
19125 const NAME: &'static str = "GLOBAL_POSITION_INT";
19126 const EXTRA_CRC: u8 = 104u8;
19127 const ENCODED_LEN: usize = 28usize;
19128 fn deser(
19129 _version: MavlinkVersion,
19130 __input: &[u8],
19131 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19132 let avail_len = __input.len();
19133 let mut payload_buf = [0; Self::ENCODED_LEN];
19134 let mut buf = if avail_len < Self::ENCODED_LEN {
19135 payload_buf[0..avail_len].copy_from_slice(__input);
19136 Bytes::new(&payload_buf)
19137 } else {
19138 Bytes::new(__input)
19139 };
19140 let mut __struct = Self::default();
19141 __struct.time_boot_ms = buf.get_u32_le();
19142 __struct.lat = buf.get_i32_le();
19143 __struct.lon = buf.get_i32_le();
19144 __struct.alt = buf.get_i32_le();
19145 __struct.relative_alt = buf.get_i32_le();
19146 __struct.vx = buf.get_i16_le();
19147 __struct.vy = buf.get_i16_le();
19148 __struct.vz = buf.get_i16_le();
19149 __struct.hdg = buf.get_u16_le();
19150 Ok(__struct)
19151 }
19152 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19153 let mut __tmp = BytesMut::new(bytes);
19154 #[allow(clippy::absurd_extreme_comparisons)]
19155 #[allow(unused_comparisons)]
19156 if __tmp.remaining() < Self::ENCODED_LEN {
19157 panic!(
19158 "buffer is too small (need {} bytes, but got {})",
19159 Self::ENCODED_LEN,
19160 __tmp.remaining(),
19161 )
19162 }
19163 __tmp.put_u32_le(self.time_boot_ms);
19164 __tmp.put_i32_le(self.lat);
19165 __tmp.put_i32_le(self.lon);
19166 __tmp.put_i32_le(self.alt);
19167 __tmp.put_i32_le(self.relative_alt);
19168 __tmp.put_i16_le(self.vx);
19169 __tmp.put_i16_le(self.vy);
19170 __tmp.put_i16_le(self.vz);
19171 __tmp.put_u16_le(self.hdg);
19172 if matches!(version, MavlinkVersion::V2) {
19173 let len = __tmp.len();
19174 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19175 } else {
19176 __tmp.len()
19177 }
19178 }
19179}
19180#[doc = "id: 322"]
19181#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
19182#[derive(Debug, Clone, PartialEq)]
19183#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19184#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19185pub struct PARAM_EXT_VALUE_DATA {
19186 #[doc = "Total number of parameters"]
19187 pub param_count: u16,
19188 #[doc = "Index of this parameter"]
19189 pub param_index: u16,
19190 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
19191 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19192 pub param_id: [u8; 16],
19193 #[doc = "Parameter value"]
19194 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19195 pub param_value: [u8; 128],
19196 #[doc = "Parameter type."]
19197 pub param_type: MavParamExtType,
19198}
19199impl PARAM_EXT_VALUE_DATA {
19200 pub const ENCODED_LEN: usize = 149usize;
19201 pub const DEFAULT: Self = Self {
19202 param_count: 0_u16,
19203 param_index: 0_u16,
19204 param_id: [0_u8; 16usize],
19205 param_value: [0_u8; 128usize],
19206 param_type: MavParamExtType::DEFAULT,
19207 };
19208 #[cfg(feature = "arbitrary")]
19209 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19210 use arbitrary::{Arbitrary, Unstructured};
19211 let mut buf = [0u8; 1024];
19212 rng.fill_bytes(&mut buf);
19213 let mut unstructured = Unstructured::new(&buf);
19214 Self::arbitrary(&mut unstructured).unwrap_or_default()
19215 }
19216}
19217impl Default for PARAM_EXT_VALUE_DATA {
19218 fn default() -> Self {
19219 Self::DEFAULT.clone()
19220 }
19221}
19222impl MessageData for PARAM_EXT_VALUE_DATA {
19223 type Message = MavMessage;
19224 const ID: u32 = 322u32;
19225 const NAME: &'static str = "PARAM_EXT_VALUE";
19226 const EXTRA_CRC: u8 = 243u8;
19227 const ENCODED_LEN: usize = 149usize;
19228 fn deser(
19229 _version: MavlinkVersion,
19230 __input: &[u8],
19231 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19232 let avail_len = __input.len();
19233 let mut payload_buf = [0; Self::ENCODED_LEN];
19234 let mut buf = if avail_len < Self::ENCODED_LEN {
19235 payload_buf[0..avail_len].copy_from_slice(__input);
19236 Bytes::new(&payload_buf)
19237 } else {
19238 Bytes::new(__input)
19239 };
19240 let mut __struct = Self::default();
19241 __struct.param_count = buf.get_u16_le();
19242 __struct.param_index = buf.get_u16_le();
19243 for v in &mut __struct.param_id {
19244 let val = buf.get_u8();
19245 *v = val;
19246 }
19247 for v in &mut __struct.param_value {
19248 let val = buf.get_u8();
19249 *v = val;
19250 }
19251 let tmp = buf.get_u8();
19252 __struct.param_type =
19253 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19254 enum_type: "MavParamExtType",
19255 value: tmp as u32,
19256 })?;
19257 Ok(__struct)
19258 }
19259 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19260 let mut __tmp = BytesMut::new(bytes);
19261 #[allow(clippy::absurd_extreme_comparisons)]
19262 #[allow(unused_comparisons)]
19263 if __tmp.remaining() < Self::ENCODED_LEN {
19264 panic!(
19265 "buffer is too small (need {} bytes, but got {})",
19266 Self::ENCODED_LEN,
19267 __tmp.remaining(),
19268 )
19269 }
19270 __tmp.put_u16_le(self.param_count);
19271 __tmp.put_u16_le(self.param_index);
19272 for val in &self.param_id {
19273 __tmp.put_u8(*val);
19274 }
19275 for val in &self.param_value {
19276 __tmp.put_u8(*val);
19277 }
19278 __tmp.put_u8(self.param_type as u8);
19279 if matches!(version, MavlinkVersion::V2) {
19280 let len = __tmp.len();
19281 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19282 } else {
19283 __tmp.len()
19284 }
19285 }
19286}
19287#[doc = "id: 4"]
19288#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
19289#[derive(Debug, Clone, PartialEq)]
19290#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19291#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19292pub struct PING_DATA {
19293 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
19294 pub time_usec: u64,
19295 #[doc = "PING sequence"]
19296 pub seq: u32,
19297 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
19298 pub target_system: u8,
19299 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
19300 pub target_component: u8,
19301}
19302impl PING_DATA {
19303 pub const ENCODED_LEN: usize = 14usize;
19304 pub const DEFAULT: Self = Self {
19305 time_usec: 0_u64,
19306 seq: 0_u32,
19307 target_system: 0_u8,
19308 target_component: 0_u8,
19309 };
19310 #[cfg(feature = "arbitrary")]
19311 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19312 use arbitrary::{Arbitrary, Unstructured};
19313 let mut buf = [0u8; 1024];
19314 rng.fill_bytes(&mut buf);
19315 let mut unstructured = Unstructured::new(&buf);
19316 Self::arbitrary(&mut unstructured).unwrap_or_default()
19317 }
19318}
19319impl Default for PING_DATA {
19320 fn default() -> Self {
19321 Self::DEFAULT.clone()
19322 }
19323}
19324impl MessageData for PING_DATA {
19325 type Message = MavMessage;
19326 const ID: u32 = 4u32;
19327 const NAME: &'static str = "PING";
19328 const EXTRA_CRC: u8 = 237u8;
19329 const ENCODED_LEN: usize = 14usize;
19330 fn deser(
19331 _version: MavlinkVersion,
19332 __input: &[u8],
19333 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19334 let avail_len = __input.len();
19335 let mut payload_buf = [0; Self::ENCODED_LEN];
19336 let mut buf = if avail_len < Self::ENCODED_LEN {
19337 payload_buf[0..avail_len].copy_from_slice(__input);
19338 Bytes::new(&payload_buf)
19339 } else {
19340 Bytes::new(__input)
19341 };
19342 let mut __struct = Self::default();
19343 __struct.time_usec = buf.get_u64_le();
19344 __struct.seq = buf.get_u32_le();
19345 __struct.target_system = buf.get_u8();
19346 __struct.target_component = buf.get_u8();
19347 Ok(__struct)
19348 }
19349 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19350 let mut __tmp = BytesMut::new(bytes);
19351 #[allow(clippy::absurd_extreme_comparisons)]
19352 #[allow(unused_comparisons)]
19353 if __tmp.remaining() < Self::ENCODED_LEN {
19354 panic!(
19355 "buffer is too small (need {} bytes, but got {})",
19356 Self::ENCODED_LEN,
19357 __tmp.remaining(),
19358 )
19359 }
19360 __tmp.put_u64_le(self.time_usec);
19361 __tmp.put_u32_le(self.seq);
19362 __tmp.put_u8(self.target_system);
19363 __tmp.put_u8(self.target_component);
19364 if matches!(version, MavlinkVersion::V2) {
19365 let len = __tmp.len();
19366 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19367 } else {
19368 __tmp.len()
19369 }
19370 }
19371}
19372#[doc = "id: 265"]
19373#[doc = "Orientation of a mount."]
19374#[derive(Debug, Clone, PartialEq)]
19375#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19376#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19377pub struct MOUNT_ORIENTATION_DATA {
19378 #[doc = "Timestamp (time since system boot)."]
19379 pub time_boot_ms: u32,
19380 #[doc = "Roll in global frame (set to NaN for invalid)."]
19381 pub roll: f32,
19382 #[doc = "Pitch in global frame (set to NaN for invalid)."]
19383 pub pitch: f32,
19384 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
19385 pub yaw: f32,
19386 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
19387 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19388 pub yaw_absolute: f32,
19389}
19390impl MOUNT_ORIENTATION_DATA {
19391 pub const ENCODED_LEN: usize = 20usize;
19392 pub const DEFAULT: Self = Self {
19393 time_boot_ms: 0_u32,
19394 roll: 0.0_f32,
19395 pitch: 0.0_f32,
19396 yaw: 0.0_f32,
19397 yaw_absolute: 0.0_f32,
19398 };
19399 #[cfg(feature = "arbitrary")]
19400 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19401 use arbitrary::{Arbitrary, Unstructured};
19402 let mut buf = [0u8; 1024];
19403 rng.fill_bytes(&mut buf);
19404 let mut unstructured = Unstructured::new(&buf);
19405 Self::arbitrary(&mut unstructured).unwrap_or_default()
19406 }
19407}
19408impl Default for MOUNT_ORIENTATION_DATA {
19409 fn default() -> Self {
19410 Self::DEFAULT.clone()
19411 }
19412}
19413impl MessageData for MOUNT_ORIENTATION_DATA {
19414 type Message = MavMessage;
19415 const ID: u32 = 265u32;
19416 const NAME: &'static str = "MOUNT_ORIENTATION";
19417 const EXTRA_CRC: u8 = 26u8;
19418 const ENCODED_LEN: usize = 20usize;
19419 fn deser(
19420 _version: MavlinkVersion,
19421 __input: &[u8],
19422 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19423 let avail_len = __input.len();
19424 let mut payload_buf = [0; Self::ENCODED_LEN];
19425 let mut buf = if avail_len < Self::ENCODED_LEN {
19426 payload_buf[0..avail_len].copy_from_slice(__input);
19427 Bytes::new(&payload_buf)
19428 } else {
19429 Bytes::new(__input)
19430 };
19431 let mut __struct = Self::default();
19432 __struct.time_boot_ms = buf.get_u32_le();
19433 __struct.roll = buf.get_f32_le();
19434 __struct.pitch = buf.get_f32_le();
19435 __struct.yaw = buf.get_f32_le();
19436 __struct.yaw_absolute = buf.get_f32_le();
19437 Ok(__struct)
19438 }
19439 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19440 let mut __tmp = BytesMut::new(bytes);
19441 #[allow(clippy::absurd_extreme_comparisons)]
19442 #[allow(unused_comparisons)]
19443 if __tmp.remaining() < Self::ENCODED_LEN {
19444 panic!(
19445 "buffer is too small (need {} bytes, but got {})",
19446 Self::ENCODED_LEN,
19447 __tmp.remaining(),
19448 )
19449 }
19450 __tmp.put_u32_le(self.time_boot_ms);
19451 __tmp.put_f32_le(self.roll);
19452 __tmp.put_f32_le(self.pitch);
19453 __tmp.put_f32_le(self.yaw);
19454 __tmp.put_f32_le(self.yaw_absolute);
19455 if matches!(version, MavlinkVersion::V2) {
19456 let len = __tmp.len();
19457 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19458 } else {
19459 __tmp.len()
19460 }
19461 }
19462}
19463#[doc = "id: 90"]
19464#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
19465#[derive(Debug, Clone, PartialEq)]
19466#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19467#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19468pub struct HIL_STATE_DATA {
19469 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
19470 pub time_usec: u64,
19471 #[doc = "Roll angle"]
19472 pub roll: f32,
19473 #[doc = "Pitch angle"]
19474 pub pitch: f32,
19475 #[doc = "Yaw angle"]
19476 pub yaw: f32,
19477 #[doc = "Body frame roll / phi angular speed"]
19478 pub rollspeed: f32,
19479 #[doc = "Body frame pitch / theta angular speed"]
19480 pub pitchspeed: f32,
19481 #[doc = "Body frame yaw / psi angular speed"]
19482 pub yawspeed: f32,
19483 #[doc = "Latitude"]
19484 pub lat: i32,
19485 #[doc = "Longitude"]
19486 pub lon: i32,
19487 #[doc = "Altitude"]
19488 pub alt: i32,
19489 #[doc = "Ground X Speed (Latitude)"]
19490 pub vx: i16,
19491 #[doc = "Ground Y Speed (Longitude)"]
19492 pub vy: i16,
19493 #[doc = "Ground Z Speed (Altitude)"]
19494 pub vz: i16,
19495 #[doc = "X acceleration"]
19496 pub xacc: i16,
19497 #[doc = "Y acceleration"]
19498 pub yacc: i16,
19499 #[doc = "Z acceleration"]
19500 pub zacc: i16,
19501}
19502impl HIL_STATE_DATA {
19503 pub const ENCODED_LEN: usize = 56usize;
19504 pub const DEFAULT: Self = Self {
19505 time_usec: 0_u64,
19506 roll: 0.0_f32,
19507 pitch: 0.0_f32,
19508 yaw: 0.0_f32,
19509 rollspeed: 0.0_f32,
19510 pitchspeed: 0.0_f32,
19511 yawspeed: 0.0_f32,
19512 lat: 0_i32,
19513 lon: 0_i32,
19514 alt: 0_i32,
19515 vx: 0_i16,
19516 vy: 0_i16,
19517 vz: 0_i16,
19518 xacc: 0_i16,
19519 yacc: 0_i16,
19520 zacc: 0_i16,
19521 };
19522 #[cfg(feature = "arbitrary")]
19523 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19524 use arbitrary::{Arbitrary, Unstructured};
19525 let mut buf = [0u8; 1024];
19526 rng.fill_bytes(&mut buf);
19527 let mut unstructured = Unstructured::new(&buf);
19528 Self::arbitrary(&mut unstructured).unwrap_or_default()
19529 }
19530}
19531impl Default for HIL_STATE_DATA {
19532 fn default() -> Self {
19533 Self::DEFAULT.clone()
19534 }
19535}
19536impl MessageData for HIL_STATE_DATA {
19537 type Message = MavMessage;
19538 const ID: u32 = 90u32;
19539 const NAME: &'static str = "HIL_STATE";
19540 const EXTRA_CRC: u8 = 183u8;
19541 const ENCODED_LEN: usize = 56usize;
19542 fn deser(
19543 _version: MavlinkVersion,
19544 __input: &[u8],
19545 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19546 let avail_len = __input.len();
19547 let mut payload_buf = [0; Self::ENCODED_LEN];
19548 let mut buf = if avail_len < Self::ENCODED_LEN {
19549 payload_buf[0..avail_len].copy_from_slice(__input);
19550 Bytes::new(&payload_buf)
19551 } else {
19552 Bytes::new(__input)
19553 };
19554 let mut __struct = Self::default();
19555 __struct.time_usec = buf.get_u64_le();
19556 __struct.roll = buf.get_f32_le();
19557 __struct.pitch = buf.get_f32_le();
19558 __struct.yaw = buf.get_f32_le();
19559 __struct.rollspeed = buf.get_f32_le();
19560 __struct.pitchspeed = buf.get_f32_le();
19561 __struct.yawspeed = buf.get_f32_le();
19562 __struct.lat = buf.get_i32_le();
19563 __struct.lon = buf.get_i32_le();
19564 __struct.alt = buf.get_i32_le();
19565 __struct.vx = buf.get_i16_le();
19566 __struct.vy = buf.get_i16_le();
19567 __struct.vz = buf.get_i16_le();
19568 __struct.xacc = buf.get_i16_le();
19569 __struct.yacc = buf.get_i16_le();
19570 __struct.zacc = buf.get_i16_le();
19571 Ok(__struct)
19572 }
19573 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19574 let mut __tmp = BytesMut::new(bytes);
19575 #[allow(clippy::absurd_extreme_comparisons)]
19576 #[allow(unused_comparisons)]
19577 if __tmp.remaining() < Self::ENCODED_LEN {
19578 panic!(
19579 "buffer is too small (need {} bytes, but got {})",
19580 Self::ENCODED_LEN,
19581 __tmp.remaining(),
19582 )
19583 }
19584 __tmp.put_u64_le(self.time_usec);
19585 __tmp.put_f32_le(self.roll);
19586 __tmp.put_f32_le(self.pitch);
19587 __tmp.put_f32_le(self.yaw);
19588 __tmp.put_f32_le(self.rollspeed);
19589 __tmp.put_f32_le(self.pitchspeed);
19590 __tmp.put_f32_le(self.yawspeed);
19591 __tmp.put_i32_le(self.lat);
19592 __tmp.put_i32_le(self.lon);
19593 __tmp.put_i32_le(self.alt);
19594 __tmp.put_i16_le(self.vx);
19595 __tmp.put_i16_le(self.vy);
19596 __tmp.put_i16_le(self.vz);
19597 __tmp.put_i16_le(self.xacc);
19598 __tmp.put_i16_le(self.yacc);
19599 __tmp.put_i16_le(self.zacc);
19600 if matches!(version, MavlinkVersion::V2) {
19601 let len = __tmp.len();
19602 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19603 } else {
19604 __tmp.len()
19605 }
19606 }
19607}
19608#[doc = "id: 386"]
19609#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
19610#[derive(Debug, Clone, PartialEq)]
19611#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19612#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19613pub struct CAN_FRAME_DATA {
19614 #[doc = "Frame ID"]
19615 pub id: u32,
19616 #[doc = "System ID."]
19617 pub target_system: u8,
19618 #[doc = "Component ID."]
19619 pub target_component: u8,
19620 #[doc = "Bus number"]
19621 pub bus: u8,
19622 #[doc = "Frame length"]
19623 pub len: u8,
19624 #[doc = "Frame data"]
19625 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19626 pub data: [u8; 8],
19627}
19628impl CAN_FRAME_DATA {
19629 pub const ENCODED_LEN: usize = 16usize;
19630 pub const DEFAULT: Self = Self {
19631 id: 0_u32,
19632 target_system: 0_u8,
19633 target_component: 0_u8,
19634 bus: 0_u8,
19635 len: 0_u8,
19636 data: [0_u8; 8usize],
19637 };
19638 #[cfg(feature = "arbitrary")]
19639 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19640 use arbitrary::{Arbitrary, Unstructured};
19641 let mut buf = [0u8; 1024];
19642 rng.fill_bytes(&mut buf);
19643 let mut unstructured = Unstructured::new(&buf);
19644 Self::arbitrary(&mut unstructured).unwrap_or_default()
19645 }
19646}
19647impl Default for CAN_FRAME_DATA {
19648 fn default() -> Self {
19649 Self::DEFAULT.clone()
19650 }
19651}
19652impl MessageData for CAN_FRAME_DATA {
19653 type Message = MavMessage;
19654 const ID: u32 = 386u32;
19655 const NAME: &'static str = "CAN_FRAME";
19656 const EXTRA_CRC: u8 = 132u8;
19657 const ENCODED_LEN: usize = 16usize;
19658 fn deser(
19659 _version: MavlinkVersion,
19660 __input: &[u8],
19661 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19662 let avail_len = __input.len();
19663 let mut payload_buf = [0; Self::ENCODED_LEN];
19664 let mut buf = if avail_len < Self::ENCODED_LEN {
19665 payload_buf[0..avail_len].copy_from_slice(__input);
19666 Bytes::new(&payload_buf)
19667 } else {
19668 Bytes::new(__input)
19669 };
19670 let mut __struct = Self::default();
19671 __struct.id = buf.get_u32_le();
19672 __struct.target_system = buf.get_u8();
19673 __struct.target_component = buf.get_u8();
19674 __struct.bus = buf.get_u8();
19675 __struct.len = buf.get_u8();
19676 for v in &mut __struct.data {
19677 let val = buf.get_u8();
19678 *v = val;
19679 }
19680 Ok(__struct)
19681 }
19682 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19683 let mut __tmp = BytesMut::new(bytes);
19684 #[allow(clippy::absurd_extreme_comparisons)]
19685 #[allow(unused_comparisons)]
19686 if __tmp.remaining() < Self::ENCODED_LEN {
19687 panic!(
19688 "buffer is too small (need {} bytes, but got {})",
19689 Self::ENCODED_LEN,
19690 __tmp.remaining(),
19691 )
19692 }
19693 __tmp.put_u32_le(self.id);
19694 __tmp.put_u8(self.target_system);
19695 __tmp.put_u8(self.target_component);
19696 __tmp.put_u8(self.bus);
19697 __tmp.put_u8(self.len);
19698 for val in &self.data {
19699 __tmp.put_u8(*val);
19700 }
19701 if matches!(version, MavlinkVersion::V2) {
19702 let len = __tmp.len();
19703 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19704 } else {
19705 __tmp.len()
19706 }
19707 }
19708}
19709#[doc = "id: 373"]
19710#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
19711#[derive(Debug, Clone, PartialEq)]
19712#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19713#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19714pub struct GENERATOR_STATUS_DATA {
19715 #[doc = "Status flags."]
19716 pub status: MavGeneratorStatusFlag,
19717 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
19718 pub battery_current: f32,
19719 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
19720 pub load_current: f32,
19721 #[doc = "The power being generated. NaN: field not provided"]
19722 pub power_generated: f32,
19723 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
19724 pub bus_voltage: f32,
19725 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
19726 pub bat_current_setpoint: f32,
19727 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
19728 pub runtime: u32,
19729 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
19730 pub time_until_maintenance: i32,
19731 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
19732 pub generator_speed: u16,
19733 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
19734 pub rectifier_temperature: i16,
19735 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
19736 pub generator_temperature: i16,
19737}
19738impl GENERATOR_STATUS_DATA {
19739 pub const ENCODED_LEN: usize = 42usize;
19740 pub const DEFAULT: Self = Self {
19741 status: MavGeneratorStatusFlag::DEFAULT,
19742 battery_current: 0.0_f32,
19743 load_current: 0.0_f32,
19744 power_generated: 0.0_f32,
19745 bus_voltage: 0.0_f32,
19746 bat_current_setpoint: 0.0_f32,
19747 runtime: 0_u32,
19748 time_until_maintenance: 0_i32,
19749 generator_speed: 0_u16,
19750 rectifier_temperature: 0_i16,
19751 generator_temperature: 0_i16,
19752 };
19753 #[cfg(feature = "arbitrary")]
19754 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19755 use arbitrary::{Arbitrary, Unstructured};
19756 let mut buf = [0u8; 1024];
19757 rng.fill_bytes(&mut buf);
19758 let mut unstructured = Unstructured::new(&buf);
19759 Self::arbitrary(&mut unstructured).unwrap_or_default()
19760 }
19761}
19762impl Default for GENERATOR_STATUS_DATA {
19763 fn default() -> Self {
19764 Self::DEFAULT.clone()
19765 }
19766}
19767impl MessageData for GENERATOR_STATUS_DATA {
19768 type Message = MavMessage;
19769 const ID: u32 = 373u32;
19770 const NAME: &'static str = "GENERATOR_STATUS";
19771 const EXTRA_CRC: u8 = 117u8;
19772 const ENCODED_LEN: usize = 42usize;
19773 fn deser(
19774 _version: MavlinkVersion,
19775 __input: &[u8],
19776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19777 let avail_len = __input.len();
19778 let mut payload_buf = [0; Self::ENCODED_LEN];
19779 let mut buf = if avail_len < Self::ENCODED_LEN {
19780 payload_buf[0..avail_len].copy_from_slice(__input);
19781 Bytes::new(&payload_buf)
19782 } else {
19783 Bytes::new(__input)
19784 };
19785 let mut __struct = Self::default();
19786 let tmp = buf.get_u64_le();
19787 __struct.status = MavGeneratorStatusFlag::from_bits(
19788 tmp & MavGeneratorStatusFlag::all().bits(),
19789 )
19790 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
19791 flag_type: "MavGeneratorStatusFlag",
19792 value: tmp as u32,
19793 })?;
19794 __struct.battery_current = buf.get_f32_le();
19795 __struct.load_current = buf.get_f32_le();
19796 __struct.power_generated = buf.get_f32_le();
19797 __struct.bus_voltage = buf.get_f32_le();
19798 __struct.bat_current_setpoint = buf.get_f32_le();
19799 __struct.runtime = buf.get_u32_le();
19800 __struct.time_until_maintenance = buf.get_i32_le();
19801 __struct.generator_speed = buf.get_u16_le();
19802 __struct.rectifier_temperature = buf.get_i16_le();
19803 __struct.generator_temperature = buf.get_i16_le();
19804 Ok(__struct)
19805 }
19806 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19807 let mut __tmp = BytesMut::new(bytes);
19808 #[allow(clippy::absurd_extreme_comparisons)]
19809 #[allow(unused_comparisons)]
19810 if __tmp.remaining() < Self::ENCODED_LEN {
19811 panic!(
19812 "buffer is too small (need {} bytes, but got {})",
19813 Self::ENCODED_LEN,
19814 __tmp.remaining(),
19815 )
19816 }
19817 __tmp.put_u64_le(self.status.bits());
19818 __tmp.put_f32_le(self.battery_current);
19819 __tmp.put_f32_le(self.load_current);
19820 __tmp.put_f32_le(self.power_generated);
19821 __tmp.put_f32_le(self.bus_voltage);
19822 __tmp.put_f32_le(self.bat_current_setpoint);
19823 __tmp.put_u32_le(self.runtime);
19824 __tmp.put_i32_le(self.time_until_maintenance);
19825 __tmp.put_u16_le(self.generator_speed);
19826 __tmp.put_i16_le(self.rectifier_temperature);
19827 __tmp.put_i16_le(self.generator_temperature);
19828 if matches!(version, MavlinkVersion::V2) {
19829 let len = __tmp.len();
19830 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19831 } else {
19832 __tmp.len()
19833 }
19834 }
19835}
19836#[doc = "id: 320"]
19837#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
19838#[derive(Debug, Clone, PartialEq)]
19839#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19840#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19841pub struct PARAM_EXT_REQUEST_READ_DATA {
19842 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
19843 pub param_index: i16,
19844 #[doc = "System ID"]
19845 pub target_system: u8,
19846 #[doc = "Component ID"]
19847 pub target_component: u8,
19848 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
19849 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19850 pub param_id: [u8; 16],
19851}
19852impl PARAM_EXT_REQUEST_READ_DATA {
19853 pub const ENCODED_LEN: usize = 20usize;
19854 pub const DEFAULT: Self = Self {
19855 param_index: 0_i16,
19856 target_system: 0_u8,
19857 target_component: 0_u8,
19858 param_id: [0_u8; 16usize],
19859 };
19860 #[cfg(feature = "arbitrary")]
19861 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19862 use arbitrary::{Arbitrary, Unstructured};
19863 let mut buf = [0u8; 1024];
19864 rng.fill_bytes(&mut buf);
19865 let mut unstructured = Unstructured::new(&buf);
19866 Self::arbitrary(&mut unstructured).unwrap_or_default()
19867 }
19868}
19869impl Default for PARAM_EXT_REQUEST_READ_DATA {
19870 fn default() -> Self {
19871 Self::DEFAULT.clone()
19872 }
19873}
19874impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
19875 type Message = MavMessage;
19876 const ID: u32 = 320u32;
19877 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
19878 const EXTRA_CRC: u8 = 243u8;
19879 const ENCODED_LEN: usize = 20usize;
19880 fn deser(
19881 _version: MavlinkVersion,
19882 __input: &[u8],
19883 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19884 let avail_len = __input.len();
19885 let mut payload_buf = [0; Self::ENCODED_LEN];
19886 let mut buf = if avail_len < Self::ENCODED_LEN {
19887 payload_buf[0..avail_len].copy_from_slice(__input);
19888 Bytes::new(&payload_buf)
19889 } else {
19890 Bytes::new(__input)
19891 };
19892 let mut __struct = Self::default();
19893 __struct.param_index = buf.get_i16_le();
19894 __struct.target_system = buf.get_u8();
19895 __struct.target_component = buf.get_u8();
19896 for v in &mut __struct.param_id {
19897 let val = buf.get_u8();
19898 *v = val;
19899 }
19900 Ok(__struct)
19901 }
19902 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19903 let mut __tmp = BytesMut::new(bytes);
19904 #[allow(clippy::absurd_extreme_comparisons)]
19905 #[allow(unused_comparisons)]
19906 if __tmp.remaining() < Self::ENCODED_LEN {
19907 panic!(
19908 "buffer is too small (need {} bytes, but got {})",
19909 Self::ENCODED_LEN,
19910 __tmp.remaining(),
19911 )
19912 }
19913 __tmp.put_i16_le(self.param_index);
19914 __tmp.put_u8(self.target_system);
19915 __tmp.put_u8(self.target_component);
19916 for val in &self.param_id {
19917 __tmp.put_u8(*val);
19918 }
19919 if matches!(version, MavlinkVersion::V2) {
19920 let len = __tmp.len();
19921 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19922 } else {
19923 __tmp.len()
19924 }
19925 }
19926}
19927#[doc = "id: 22"]
19928#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
19929#[derive(Debug, Clone, PartialEq)]
19930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19931#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19932pub struct PARAM_VALUE_DATA {
19933 #[doc = "Onboard parameter value"]
19934 pub param_value: f32,
19935 #[doc = "Total number of onboard parameters"]
19936 pub param_count: u16,
19937 #[doc = "Index of this onboard parameter"]
19938 pub param_index: u16,
19939 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
19940 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
19941 pub param_id: [u8; 16],
19942 #[doc = "Onboard parameter type."]
19943 pub param_type: MavParamType,
19944}
19945impl PARAM_VALUE_DATA {
19946 pub const ENCODED_LEN: usize = 25usize;
19947 pub const DEFAULT: Self = Self {
19948 param_value: 0.0_f32,
19949 param_count: 0_u16,
19950 param_index: 0_u16,
19951 param_id: [0_u8; 16usize],
19952 param_type: MavParamType::DEFAULT,
19953 };
19954 #[cfg(feature = "arbitrary")]
19955 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19956 use arbitrary::{Arbitrary, Unstructured};
19957 let mut buf = [0u8; 1024];
19958 rng.fill_bytes(&mut buf);
19959 let mut unstructured = Unstructured::new(&buf);
19960 Self::arbitrary(&mut unstructured).unwrap_or_default()
19961 }
19962}
19963impl Default for PARAM_VALUE_DATA {
19964 fn default() -> Self {
19965 Self::DEFAULT.clone()
19966 }
19967}
19968impl MessageData for PARAM_VALUE_DATA {
19969 type Message = MavMessage;
19970 const ID: u32 = 22u32;
19971 const NAME: &'static str = "PARAM_VALUE";
19972 const EXTRA_CRC: u8 = 220u8;
19973 const ENCODED_LEN: usize = 25usize;
19974 fn deser(
19975 _version: MavlinkVersion,
19976 __input: &[u8],
19977 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19978 let avail_len = __input.len();
19979 let mut payload_buf = [0; Self::ENCODED_LEN];
19980 let mut buf = if avail_len < Self::ENCODED_LEN {
19981 payload_buf[0..avail_len].copy_from_slice(__input);
19982 Bytes::new(&payload_buf)
19983 } else {
19984 Bytes::new(__input)
19985 };
19986 let mut __struct = Self::default();
19987 __struct.param_value = buf.get_f32_le();
19988 __struct.param_count = buf.get_u16_le();
19989 __struct.param_index = buf.get_u16_le();
19990 for v in &mut __struct.param_id {
19991 let val = buf.get_u8();
19992 *v = val;
19993 }
19994 let tmp = buf.get_u8();
19995 __struct.param_type =
19996 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19997 enum_type: "MavParamType",
19998 value: tmp as u32,
19999 })?;
20000 Ok(__struct)
20001 }
20002 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20003 let mut __tmp = BytesMut::new(bytes);
20004 #[allow(clippy::absurd_extreme_comparisons)]
20005 #[allow(unused_comparisons)]
20006 if __tmp.remaining() < Self::ENCODED_LEN {
20007 panic!(
20008 "buffer is too small (need {} bytes, but got {})",
20009 Self::ENCODED_LEN,
20010 __tmp.remaining(),
20011 )
20012 }
20013 __tmp.put_f32_le(self.param_value);
20014 __tmp.put_u16_le(self.param_count);
20015 __tmp.put_u16_le(self.param_index);
20016 for val in &self.param_id {
20017 __tmp.put_u8(*val);
20018 }
20019 __tmp.put_u8(self.param_type as u8);
20020 if matches!(version, MavlinkVersion::V2) {
20021 let len = __tmp.len();
20022 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20023 } else {
20024 __tmp.len()
20025 }
20026 }
20027}
20028#[doc = "id: 247"]
20029#[doc = "Information about a potential collision."]
20030#[derive(Debug, Clone, PartialEq)]
20031#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20032#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20033pub struct COLLISION_DATA {
20034 #[doc = "Unique identifier, domain based on src field"]
20035 pub id: u32,
20036 #[doc = "Estimated time until collision occurs"]
20037 pub time_to_minimum_delta: f32,
20038 #[doc = "Closest vertical distance between vehicle and object"]
20039 pub altitude_minimum_delta: f32,
20040 #[doc = "Closest horizontal distance between vehicle and object"]
20041 pub horizontal_minimum_delta: f32,
20042 #[doc = "Collision data source"]
20043 pub src: MavCollisionSrc,
20044 #[doc = "Action that is being taken to avoid this collision"]
20045 pub action: MavCollisionAction,
20046 #[doc = "How concerned the aircraft is about this collision"]
20047 pub threat_level: MavCollisionThreatLevel,
20048}
20049impl COLLISION_DATA {
20050 pub const ENCODED_LEN: usize = 19usize;
20051 pub const DEFAULT: Self = Self {
20052 id: 0_u32,
20053 time_to_minimum_delta: 0.0_f32,
20054 altitude_minimum_delta: 0.0_f32,
20055 horizontal_minimum_delta: 0.0_f32,
20056 src: MavCollisionSrc::DEFAULT,
20057 action: MavCollisionAction::DEFAULT,
20058 threat_level: MavCollisionThreatLevel::DEFAULT,
20059 };
20060 #[cfg(feature = "arbitrary")]
20061 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20062 use arbitrary::{Arbitrary, Unstructured};
20063 let mut buf = [0u8; 1024];
20064 rng.fill_bytes(&mut buf);
20065 let mut unstructured = Unstructured::new(&buf);
20066 Self::arbitrary(&mut unstructured).unwrap_or_default()
20067 }
20068}
20069impl Default for COLLISION_DATA {
20070 fn default() -> Self {
20071 Self::DEFAULT.clone()
20072 }
20073}
20074impl MessageData for COLLISION_DATA {
20075 type Message = MavMessage;
20076 const ID: u32 = 247u32;
20077 const NAME: &'static str = "COLLISION";
20078 const EXTRA_CRC: u8 = 81u8;
20079 const ENCODED_LEN: usize = 19usize;
20080 fn deser(
20081 _version: MavlinkVersion,
20082 __input: &[u8],
20083 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20084 let avail_len = __input.len();
20085 let mut payload_buf = [0; Self::ENCODED_LEN];
20086 let mut buf = if avail_len < Self::ENCODED_LEN {
20087 payload_buf[0..avail_len].copy_from_slice(__input);
20088 Bytes::new(&payload_buf)
20089 } else {
20090 Bytes::new(__input)
20091 };
20092 let mut __struct = Self::default();
20093 __struct.id = buf.get_u32_le();
20094 __struct.time_to_minimum_delta = buf.get_f32_le();
20095 __struct.altitude_minimum_delta = buf.get_f32_le();
20096 __struct.horizontal_minimum_delta = buf.get_f32_le();
20097 let tmp = buf.get_u8();
20098 __struct.src =
20099 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20100 enum_type: "MavCollisionSrc",
20101 value: tmp as u32,
20102 })?;
20103 let tmp = buf.get_u8();
20104 __struct.action =
20105 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20106 enum_type: "MavCollisionAction",
20107 value: tmp as u32,
20108 })?;
20109 let tmp = buf.get_u8();
20110 __struct.threat_level =
20111 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20112 enum_type: "MavCollisionThreatLevel",
20113 value: tmp as u32,
20114 })?;
20115 Ok(__struct)
20116 }
20117 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20118 let mut __tmp = BytesMut::new(bytes);
20119 #[allow(clippy::absurd_extreme_comparisons)]
20120 #[allow(unused_comparisons)]
20121 if __tmp.remaining() < Self::ENCODED_LEN {
20122 panic!(
20123 "buffer is too small (need {} bytes, but got {})",
20124 Self::ENCODED_LEN,
20125 __tmp.remaining(),
20126 )
20127 }
20128 __tmp.put_u32_le(self.id);
20129 __tmp.put_f32_le(self.time_to_minimum_delta);
20130 __tmp.put_f32_le(self.altitude_minimum_delta);
20131 __tmp.put_f32_le(self.horizontal_minimum_delta);
20132 __tmp.put_u8(self.src as u8);
20133 __tmp.put_u8(self.action as u8);
20134 __tmp.put_u8(self.threat_level as u8);
20135 if matches!(version, MavlinkVersion::V2) {
20136 let len = __tmp.len();
20137 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20138 } else {
20139 __tmp.len()
20140 }
20141 }
20142}
20143#[doc = "id: 55"]
20144#[doc = "Read out the safety zone the MAV currently assumes."]
20145#[derive(Debug, Clone, PartialEq)]
20146#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20147#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20148pub struct SAFETY_ALLOWED_AREA_DATA {
20149 #[doc = "x position 1 / Latitude 1"]
20150 pub p1x: f32,
20151 #[doc = "y position 1 / Longitude 1"]
20152 pub p1y: f32,
20153 #[doc = "z position 1 / Altitude 1"]
20154 pub p1z: f32,
20155 #[doc = "x position 2 / Latitude 2"]
20156 pub p2x: f32,
20157 #[doc = "y position 2 / Longitude 2"]
20158 pub p2y: f32,
20159 #[doc = "z position 2 / Altitude 2"]
20160 pub p2z: f32,
20161 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
20162 pub frame: MavFrame,
20163}
20164impl SAFETY_ALLOWED_AREA_DATA {
20165 pub const ENCODED_LEN: usize = 25usize;
20166 pub const DEFAULT: Self = Self {
20167 p1x: 0.0_f32,
20168 p1y: 0.0_f32,
20169 p1z: 0.0_f32,
20170 p2x: 0.0_f32,
20171 p2y: 0.0_f32,
20172 p2z: 0.0_f32,
20173 frame: MavFrame::DEFAULT,
20174 };
20175 #[cfg(feature = "arbitrary")]
20176 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20177 use arbitrary::{Arbitrary, Unstructured};
20178 let mut buf = [0u8; 1024];
20179 rng.fill_bytes(&mut buf);
20180 let mut unstructured = Unstructured::new(&buf);
20181 Self::arbitrary(&mut unstructured).unwrap_or_default()
20182 }
20183}
20184impl Default for SAFETY_ALLOWED_AREA_DATA {
20185 fn default() -> Self {
20186 Self::DEFAULT.clone()
20187 }
20188}
20189impl MessageData for SAFETY_ALLOWED_AREA_DATA {
20190 type Message = MavMessage;
20191 const ID: u32 = 55u32;
20192 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
20193 const EXTRA_CRC: u8 = 3u8;
20194 const ENCODED_LEN: usize = 25usize;
20195 fn deser(
20196 _version: MavlinkVersion,
20197 __input: &[u8],
20198 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20199 let avail_len = __input.len();
20200 let mut payload_buf = [0; Self::ENCODED_LEN];
20201 let mut buf = if avail_len < Self::ENCODED_LEN {
20202 payload_buf[0..avail_len].copy_from_slice(__input);
20203 Bytes::new(&payload_buf)
20204 } else {
20205 Bytes::new(__input)
20206 };
20207 let mut __struct = Self::default();
20208 __struct.p1x = buf.get_f32_le();
20209 __struct.p1y = buf.get_f32_le();
20210 __struct.p1z = buf.get_f32_le();
20211 __struct.p2x = buf.get_f32_le();
20212 __struct.p2y = buf.get_f32_le();
20213 __struct.p2z = buf.get_f32_le();
20214 let tmp = buf.get_u8();
20215 __struct.frame =
20216 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20217 enum_type: "MavFrame",
20218 value: tmp as u32,
20219 })?;
20220 Ok(__struct)
20221 }
20222 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20223 let mut __tmp = BytesMut::new(bytes);
20224 #[allow(clippy::absurd_extreme_comparisons)]
20225 #[allow(unused_comparisons)]
20226 if __tmp.remaining() < Self::ENCODED_LEN {
20227 panic!(
20228 "buffer is too small (need {} bytes, but got {})",
20229 Self::ENCODED_LEN,
20230 __tmp.remaining(),
20231 )
20232 }
20233 __tmp.put_f32_le(self.p1x);
20234 __tmp.put_f32_le(self.p1y);
20235 __tmp.put_f32_le(self.p1z);
20236 __tmp.put_f32_le(self.p2x);
20237 __tmp.put_f32_le(self.p2y);
20238 __tmp.put_f32_le(self.p2z);
20239 __tmp.put_u8(self.frame as u8);
20240 if matches!(version, MavlinkVersion::V2) {
20241 let len = __tmp.len();
20242 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20243 } else {
20244 __tmp.len()
20245 }
20246 }
20247}
20248#[doc = "id: 250"]
20249#[doc = "To debug something using a named 3D vector."]
20250#[derive(Debug, Clone, PartialEq)]
20251#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20252#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20253pub struct DEBUG_VECT_DATA {
20254 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20255 pub time_usec: u64,
20256 #[doc = "x"]
20257 pub x: f32,
20258 #[doc = "y"]
20259 pub y: f32,
20260 #[doc = "z"]
20261 pub z: f32,
20262 #[doc = "Name"]
20263 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20264 pub name: [u8; 10],
20265}
20266impl DEBUG_VECT_DATA {
20267 pub const ENCODED_LEN: usize = 30usize;
20268 pub const DEFAULT: Self = Self {
20269 time_usec: 0_u64,
20270 x: 0.0_f32,
20271 y: 0.0_f32,
20272 z: 0.0_f32,
20273 name: [0_u8; 10usize],
20274 };
20275 #[cfg(feature = "arbitrary")]
20276 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20277 use arbitrary::{Arbitrary, Unstructured};
20278 let mut buf = [0u8; 1024];
20279 rng.fill_bytes(&mut buf);
20280 let mut unstructured = Unstructured::new(&buf);
20281 Self::arbitrary(&mut unstructured).unwrap_or_default()
20282 }
20283}
20284impl Default for DEBUG_VECT_DATA {
20285 fn default() -> Self {
20286 Self::DEFAULT.clone()
20287 }
20288}
20289impl MessageData for DEBUG_VECT_DATA {
20290 type Message = MavMessage;
20291 const ID: u32 = 250u32;
20292 const NAME: &'static str = "DEBUG_VECT";
20293 const EXTRA_CRC: u8 = 49u8;
20294 const ENCODED_LEN: usize = 30usize;
20295 fn deser(
20296 _version: MavlinkVersion,
20297 __input: &[u8],
20298 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20299 let avail_len = __input.len();
20300 let mut payload_buf = [0; Self::ENCODED_LEN];
20301 let mut buf = if avail_len < Self::ENCODED_LEN {
20302 payload_buf[0..avail_len].copy_from_slice(__input);
20303 Bytes::new(&payload_buf)
20304 } else {
20305 Bytes::new(__input)
20306 };
20307 let mut __struct = Self::default();
20308 __struct.time_usec = buf.get_u64_le();
20309 __struct.x = buf.get_f32_le();
20310 __struct.y = buf.get_f32_le();
20311 __struct.z = buf.get_f32_le();
20312 for v in &mut __struct.name {
20313 let val = buf.get_u8();
20314 *v = val;
20315 }
20316 Ok(__struct)
20317 }
20318 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20319 let mut __tmp = BytesMut::new(bytes);
20320 #[allow(clippy::absurd_extreme_comparisons)]
20321 #[allow(unused_comparisons)]
20322 if __tmp.remaining() < Self::ENCODED_LEN {
20323 panic!(
20324 "buffer is too small (need {} bytes, but got {})",
20325 Self::ENCODED_LEN,
20326 __tmp.remaining(),
20327 )
20328 }
20329 __tmp.put_u64_le(self.time_usec);
20330 __tmp.put_f32_le(self.x);
20331 __tmp.put_f32_le(self.y);
20332 __tmp.put_f32_le(self.z);
20333 for val in &self.name {
20334 __tmp.put_u8(*val);
20335 }
20336 if matches!(version, MavlinkVersion::V2) {
20337 let len = __tmp.len();
20338 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20339 } else {
20340 __tmp.len()
20341 }
20342 }
20343}
20344#[doc = "id: 70"]
20345#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
20346#[derive(Debug, Clone, PartialEq)]
20347#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20348#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20349pub struct RC_CHANNELS_OVERRIDE_DATA {
20350 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
20351 pub chan1_raw: u16,
20352 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
20353 pub chan2_raw: u16,
20354 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
20355 pub chan3_raw: u16,
20356 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
20357 pub chan4_raw: u16,
20358 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
20359 pub chan5_raw: u16,
20360 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
20361 pub chan6_raw: u16,
20362 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
20363 pub chan7_raw: u16,
20364 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
20365 pub chan8_raw: u16,
20366 #[doc = "System ID"]
20367 pub target_system: u8,
20368 #[doc = "Component ID"]
20369 pub target_component: u8,
20370 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
20371 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20372 pub chan9_raw: u16,
20373 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
20374 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20375 pub chan10_raw: u16,
20376 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
20377 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20378 pub chan11_raw: u16,
20379 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
20380 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20381 pub chan12_raw: u16,
20382 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
20383 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20384 pub chan13_raw: u16,
20385 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
20386 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20387 pub chan14_raw: u16,
20388 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
20389 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20390 pub chan15_raw: u16,
20391 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
20392 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20393 pub chan16_raw: u16,
20394 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
20395 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20396 pub chan17_raw: u16,
20397 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
20398 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20399 pub chan18_raw: u16,
20400}
20401impl RC_CHANNELS_OVERRIDE_DATA {
20402 pub const ENCODED_LEN: usize = 38usize;
20403 pub const DEFAULT: Self = Self {
20404 chan1_raw: 0_u16,
20405 chan2_raw: 0_u16,
20406 chan3_raw: 0_u16,
20407 chan4_raw: 0_u16,
20408 chan5_raw: 0_u16,
20409 chan6_raw: 0_u16,
20410 chan7_raw: 0_u16,
20411 chan8_raw: 0_u16,
20412 target_system: 0_u8,
20413 target_component: 0_u8,
20414 chan9_raw: 0_u16,
20415 chan10_raw: 0_u16,
20416 chan11_raw: 0_u16,
20417 chan12_raw: 0_u16,
20418 chan13_raw: 0_u16,
20419 chan14_raw: 0_u16,
20420 chan15_raw: 0_u16,
20421 chan16_raw: 0_u16,
20422 chan17_raw: 0_u16,
20423 chan18_raw: 0_u16,
20424 };
20425 #[cfg(feature = "arbitrary")]
20426 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20427 use arbitrary::{Arbitrary, Unstructured};
20428 let mut buf = [0u8; 1024];
20429 rng.fill_bytes(&mut buf);
20430 let mut unstructured = Unstructured::new(&buf);
20431 Self::arbitrary(&mut unstructured).unwrap_or_default()
20432 }
20433}
20434impl Default for RC_CHANNELS_OVERRIDE_DATA {
20435 fn default() -> Self {
20436 Self::DEFAULT.clone()
20437 }
20438}
20439impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
20440 type Message = MavMessage;
20441 const ID: u32 = 70u32;
20442 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
20443 const EXTRA_CRC: u8 = 124u8;
20444 const ENCODED_LEN: usize = 38usize;
20445 fn deser(
20446 _version: MavlinkVersion,
20447 __input: &[u8],
20448 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20449 let avail_len = __input.len();
20450 let mut payload_buf = [0; Self::ENCODED_LEN];
20451 let mut buf = if avail_len < Self::ENCODED_LEN {
20452 payload_buf[0..avail_len].copy_from_slice(__input);
20453 Bytes::new(&payload_buf)
20454 } else {
20455 Bytes::new(__input)
20456 };
20457 let mut __struct = Self::default();
20458 __struct.chan1_raw = buf.get_u16_le();
20459 __struct.chan2_raw = buf.get_u16_le();
20460 __struct.chan3_raw = buf.get_u16_le();
20461 __struct.chan4_raw = buf.get_u16_le();
20462 __struct.chan5_raw = buf.get_u16_le();
20463 __struct.chan6_raw = buf.get_u16_le();
20464 __struct.chan7_raw = buf.get_u16_le();
20465 __struct.chan8_raw = buf.get_u16_le();
20466 __struct.target_system = buf.get_u8();
20467 __struct.target_component = buf.get_u8();
20468 __struct.chan9_raw = buf.get_u16_le();
20469 __struct.chan10_raw = buf.get_u16_le();
20470 __struct.chan11_raw = buf.get_u16_le();
20471 __struct.chan12_raw = buf.get_u16_le();
20472 __struct.chan13_raw = buf.get_u16_le();
20473 __struct.chan14_raw = buf.get_u16_le();
20474 __struct.chan15_raw = buf.get_u16_le();
20475 __struct.chan16_raw = buf.get_u16_le();
20476 __struct.chan17_raw = buf.get_u16_le();
20477 __struct.chan18_raw = buf.get_u16_le();
20478 Ok(__struct)
20479 }
20480 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20481 let mut __tmp = BytesMut::new(bytes);
20482 #[allow(clippy::absurd_extreme_comparisons)]
20483 #[allow(unused_comparisons)]
20484 if __tmp.remaining() < Self::ENCODED_LEN {
20485 panic!(
20486 "buffer is too small (need {} bytes, but got {})",
20487 Self::ENCODED_LEN,
20488 __tmp.remaining(),
20489 )
20490 }
20491 __tmp.put_u16_le(self.chan1_raw);
20492 __tmp.put_u16_le(self.chan2_raw);
20493 __tmp.put_u16_le(self.chan3_raw);
20494 __tmp.put_u16_le(self.chan4_raw);
20495 __tmp.put_u16_le(self.chan5_raw);
20496 __tmp.put_u16_le(self.chan6_raw);
20497 __tmp.put_u16_le(self.chan7_raw);
20498 __tmp.put_u16_le(self.chan8_raw);
20499 __tmp.put_u8(self.target_system);
20500 __tmp.put_u8(self.target_component);
20501 __tmp.put_u16_le(self.chan9_raw);
20502 __tmp.put_u16_le(self.chan10_raw);
20503 __tmp.put_u16_le(self.chan11_raw);
20504 __tmp.put_u16_le(self.chan12_raw);
20505 __tmp.put_u16_le(self.chan13_raw);
20506 __tmp.put_u16_le(self.chan14_raw);
20507 __tmp.put_u16_le(self.chan15_raw);
20508 __tmp.put_u16_le(self.chan16_raw);
20509 __tmp.put_u16_le(self.chan17_raw);
20510 __tmp.put_u16_le(self.chan18_raw);
20511 if matches!(version, MavlinkVersion::V2) {
20512 let len = __tmp.len();
20513 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20514 } else {
20515 __tmp.len()
20516 }
20517 }
20518}
20519#[doc = "id: 232"]
20520#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
20521#[derive(Debug, Clone, PartialEq)]
20522#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20523#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20524pub struct GPS_INPUT_DATA {
20525 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20526 pub time_usec: u64,
20527 #[doc = "GPS time (from start of GPS week)"]
20528 pub time_week_ms: u32,
20529 #[doc = "Latitude (WGS84)"]
20530 pub lat: i32,
20531 #[doc = "Longitude (WGS84)"]
20532 pub lon: i32,
20533 #[doc = "Altitude (MSL). Positive for up."]
20534 pub alt: f32,
20535 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
20536 pub hdop: f32,
20537 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
20538 pub vdop: f32,
20539 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
20540 pub vn: f32,
20541 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
20542 pub ve: f32,
20543 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
20544 pub vd: f32,
20545 #[doc = "GPS speed accuracy"]
20546 pub speed_accuracy: f32,
20547 #[doc = "GPS horizontal accuracy"]
20548 pub horiz_accuracy: f32,
20549 #[doc = "GPS vertical accuracy"]
20550 pub vert_accuracy: f32,
20551 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
20552 pub ignore_flags: GpsInputIgnoreFlags,
20553 #[doc = "GPS week number"]
20554 pub time_week: u16,
20555 #[doc = "ID of the GPS for multiple GPS inputs"]
20556 pub gps_id: u8,
20557 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
20558 pub fix_type: u8,
20559 #[doc = "Number of satellites visible."]
20560 pub satellites_visible: u8,
20561 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
20562 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20563 pub yaw: u16,
20564}
20565impl GPS_INPUT_DATA {
20566 pub const ENCODED_LEN: usize = 65usize;
20567 pub const DEFAULT: Self = Self {
20568 time_usec: 0_u64,
20569 time_week_ms: 0_u32,
20570 lat: 0_i32,
20571 lon: 0_i32,
20572 alt: 0.0_f32,
20573 hdop: 0.0_f32,
20574 vdop: 0.0_f32,
20575 vn: 0.0_f32,
20576 ve: 0.0_f32,
20577 vd: 0.0_f32,
20578 speed_accuracy: 0.0_f32,
20579 horiz_accuracy: 0.0_f32,
20580 vert_accuracy: 0.0_f32,
20581 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
20582 time_week: 0_u16,
20583 gps_id: 0_u8,
20584 fix_type: 0_u8,
20585 satellites_visible: 0_u8,
20586 yaw: 0_u16,
20587 };
20588 #[cfg(feature = "arbitrary")]
20589 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20590 use arbitrary::{Arbitrary, Unstructured};
20591 let mut buf = [0u8; 1024];
20592 rng.fill_bytes(&mut buf);
20593 let mut unstructured = Unstructured::new(&buf);
20594 Self::arbitrary(&mut unstructured).unwrap_or_default()
20595 }
20596}
20597impl Default for GPS_INPUT_DATA {
20598 fn default() -> Self {
20599 Self::DEFAULT.clone()
20600 }
20601}
20602impl MessageData for GPS_INPUT_DATA {
20603 type Message = MavMessage;
20604 const ID: u32 = 232u32;
20605 const NAME: &'static str = "GPS_INPUT";
20606 const EXTRA_CRC: u8 = 151u8;
20607 const ENCODED_LEN: usize = 65usize;
20608 fn deser(
20609 _version: MavlinkVersion,
20610 __input: &[u8],
20611 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20612 let avail_len = __input.len();
20613 let mut payload_buf = [0; Self::ENCODED_LEN];
20614 let mut buf = if avail_len < Self::ENCODED_LEN {
20615 payload_buf[0..avail_len].copy_from_slice(__input);
20616 Bytes::new(&payload_buf)
20617 } else {
20618 Bytes::new(__input)
20619 };
20620 let mut __struct = Self::default();
20621 __struct.time_usec = buf.get_u64_le();
20622 __struct.time_week_ms = buf.get_u32_le();
20623 __struct.lat = buf.get_i32_le();
20624 __struct.lon = buf.get_i32_le();
20625 __struct.alt = buf.get_f32_le();
20626 __struct.hdop = buf.get_f32_le();
20627 __struct.vdop = buf.get_f32_le();
20628 __struct.vn = buf.get_f32_le();
20629 __struct.ve = buf.get_f32_le();
20630 __struct.vd = buf.get_f32_le();
20631 __struct.speed_accuracy = buf.get_f32_le();
20632 __struct.horiz_accuracy = buf.get_f32_le();
20633 __struct.vert_accuracy = buf.get_f32_le();
20634 let tmp = buf.get_u16_le();
20635 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
20636 tmp & GpsInputIgnoreFlags::all().bits(),
20637 )
20638 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
20639 flag_type: "GpsInputIgnoreFlags",
20640 value: tmp as u32,
20641 })?;
20642 __struct.time_week = buf.get_u16_le();
20643 __struct.gps_id = buf.get_u8();
20644 __struct.fix_type = buf.get_u8();
20645 __struct.satellites_visible = buf.get_u8();
20646 __struct.yaw = buf.get_u16_le();
20647 Ok(__struct)
20648 }
20649 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20650 let mut __tmp = BytesMut::new(bytes);
20651 #[allow(clippy::absurd_extreme_comparisons)]
20652 #[allow(unused_comparisons)]
20653 if __tmp.remaining() < Self::ENCODED_LEN {
20654 panic!(
20655 "buffer is too small (need {} bytes, but got {})",
20656 Self::ENCODED_LEN,
20657 __tmp.remaining(),
20658 )
20659 }
20660 __tmp.put_u64_le(self.time_usec);
20661 __tmp.put_u32_le(self.time_week_ms);
20662 __tmp.put_i32_le(self.lat);
20663 __tmp.put_i32_le(self.lon);
20664 __tmp.put_f32_le(self.alt);
20665 __tmp.put_f32_le(self.hdop);
20666 __tmp.put_f32_le(self.vdop);
20667 __tmp.put_f32_le(self.vn);
20668 __tmp.put_f32_le(self.ve);
20669 __tmp.put_f32_le(self.vd);
20670 __tmp.put_f32_le(self.speed_accuracy);
20671 __tmp.put_f32_le(self.horiz_accuracy);
20672 __tmp.put_f32_le(self.vert_accuracy);
20673 __tmp.put_u16_le(self.ignore_flags.bits());
20674 __tmp.put_u16_le(self.time_week);
20675 __tmp.put_u8(self.gps_id);
20676 __tmp.put_u8(self.fix_type);
20677 __tmp.put_u8(self.satellites_visible);
20678 __tmp.put_u16_le(self.yaw);
20679 if matches!(version, MavlinkVersion::V2) {
20680 let len = __tmp.len();
20681 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20682 } else {
20683 __tmp.len()
20684 }
20685 }
20686}
20687#[doc = "id: 126"]
20688#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
20689#[derive(Debug, Clone, PartialEq)]
20690#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20691#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20692pub struct SERIAL_CONTROL_DATA {
20693 #[doc = "Baudrate of transfer. Zero means no change."]
20694 pub baudrate: u32,
20695 #[doc = "Timeout for reply data"]
20696 pub timeout: u16,
20697 #[doc = "Serial control device type."]
20698 pub device: SerialControlDev,
20699 #[doc = "Bitmap of serial control flags."]
20700 pub flags: SerialControlFlag,
20701 #[doc = "how many bytes in this transfer"]
20702 pub count: u8,
20703 #[doc = "serial data"]
20704 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20705 pub data: [u8; 70],
20706 #[doc = "System ID"]
20707 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20708 pub target_system: u8,
20709 #[doc = "Component ID"]
20710 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20711 pub target_component: u8,
20712}
20713impl SERIAL_CONTROL_DATA {
20714 pub const ENCODED_LEN: usize = 81usize;
20715 pub const DEFAULT: Self = Self {
20716 baudrate: 0_u32,
20717 timeout: 0_u16,
20718 device: SerialControlDev::DEFAULT,
20719 flags: SerialControlFlag::DEFAULT,
20720 count: 0_u8,
20721 data: [0_u8; 70usize],
20722 target_system: 0_u8,
20723 target_component: 0_u8,
20724 };
20725 #[cfg(feature = "arbitrary")]
20726 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20727 use arbitrary::{Arbitrary, Unstructured};
20728 let mut buf = [0u8; 1024];
20729 rng.fill_bytes(&mut buf);
20730 let mut unstructured = Unstructured::new(&buf);
20731 Self::arbitrary(&mut unstructured).unwrap_or_default()
20732 }
20733}
20734impl Default for SERIAL_CONTROL_DATA {
20735 fn default() -> Self {
20736 Self::DEFAULT.clone()
20737 }
20738}
20739impl MessageData for SERIAL_CONTROL_DATA {
20740 type Message = MavMessage;
20741 const ID: u32 = 126u32;
20742 const NAME: &'static str = "SERIAL_CONTROL";
20743 const EXTRA_CRC: u8 = 220u8;
20744 const ENCODED_LEN: usize = 81usize;
20745 fn deser(
20746 _version: MavlinkVersion,
20747 __input: &[u8],
20748 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20749 let avail_len = __input.len();
20750 let mut payload_buf = [0; Self::ENCODED_LEN];
20751 let mut buf = if avail_len < Self::ENCODED_LEN {
20752 payload_buf[0..avail_len].copy_from_slice(__input);
20753 Bytes::new(&payload_buf)
20754 } else {
20755 Bytes::new(__input)
20756 };
20757 let mut __struct = Self::default();
20758 __struct.baudrate = buf.get_u32_le();
20759 __struct.timeout = buf.get_u16_le();
20760 let tmp = buf.get_u8();
20761 __struct.device =
20762 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20763 enum_type: "SerialControlDev",
20764 value: tmp as u32,
20765 })?;
20766 let tmp = buf.get_u8();
20767 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
20768 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
20769 flag_type: "SerialControlFlag",
20770 value: tmp as u32,
20771 })?;
20772 __struct.count = buf.get_u8();
20773 for v in &mut __struct.data {
20774 let val = buf.get_u8();
20775 *v = val;
20776 }
20777 __struct.target_system = buf.get_u8();
20778 __struct.target_component = buf.get_u8();
20779 Ok(__struct)
20780 }
20781 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20782 let mut __tmp = BytesMut::new(bytes);
20783 #[allow(clippy::absurd_extreme_comparisons)]
20784 #[allow(unused_comparisons)]
20785 if __tmp.remaining() < Self::ENCODED_LEN {
20786 panic!(
20787 "buffer is too small (need {} bytes, but got {})",
20788 Self::ENCODED_LEN,
20789 __tmp.remaining(),
20790 )
20791 }
20792 __tmp.put_u32_le(self.baudrate);
20793 __tmp.put_u16_le(self.timeout);
20794 __tmp.put_u8(self.device as u8);
20795 __tmp.put_u8(self.flags.bits());
20796 __tmp.put_u8(self.count);
20797 for val in &self.data {
20798 __tmp.put_u8(*val);
20799 }
20800 __tmp.put_u8(self.target_system);
20801 __tmp.put_u8(self.target_component);
20802 if matches!(version, MavlinkVersion::V2) {
20803 let len = __tmp.len();
20804 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20805 } else {
20806 __tmp.len()
20807 }
20808 }
20809}
20810#[doc = "id: 100"]
20811#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
20812#[derive(Debug, Clone, PartialEq)]
20813#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20814#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20815pub struct OPTICAL_FLOW_DATA {
20816 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20817 pub time_usec: u64,
20818 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
20819 pub flow_comp_m_x: f32,
20820 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
20821 pub flow_comp_m_y: f32,
20822 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
20823 pub ground_distance: f32,
20824 #[doc = "Flow in x-sensor direction"]
20825 pub flow_x: i16,
20826 #[doc = "Flow in y-sensor direction"]
20827 pub flow_y: i16,
20828 #[doc = "Sensor ID"]
20829 pub sensor_id: u8,
20830 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
20831 pub quality: u8,
20832 #[doc = "Flow rate about X axis"]
20833 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20834 pub flow_rate_x: f32,
20835 #[doc = "Flow rate about Y axis"]
20836 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20837 pub flow_rate_y: f32,
20838}
20839impl OPTICAL_FLOW_DATA {
20840 pub const ENCODED_LEN: usize = 34usize;
20841 pub const DEFAULT: Self = Self {
20842 time_usec: 0_u64,
20843 flow_comp_m_x: 0.0_f32,
20844 flow_comp_m_y: 0.0_f32,
20845 ground_distance: 0.0_f32,
20846 flow_x: 0_i16,
20847 flow_y: 0_i16,
20848 sensor_id: 0_u8,
20849 quality: 0_u8,
20850 flow_rate_x: 0.0_f32,
20851 flow_rate_y: 0.0_f32,
20852 };
20853 #[cfg(feature = "arbitrary")]
20854 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20855 use arbitrary::{Arbitrary, Unstructured};
20856 let mut buf = [0u8; 1024];
20857 rng.fill_bytes(&mut buf);
20858 let mut unstructured = Unstructured::new(&buf);
20859 Self::arbitrary(&mut unstructured).unwrap_or_default()
20860 }
20861}
20862impl Default for OPTICAL_FLOW_DATA {
20863 fn default() -> Self {
20864 Self::DEFAULT.clone()
20865 }
20866}
20867impl MessageData for OPTICAL_FLOW_DATA {
20868 type Message = MavMessage;
20869 const ID: u32 = 100u32;
20870 const NAME: &'static str = "OPTICAL_FLOW";
20871 const EXTRA_CRC: u8 = 175u8;
20872 const ENCODED_LEN: usize = 34usize;
20873 fn deser(
20874 _version: MavlinkVersion,
20875 __input: &[u8],
20876 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20877 let avail_len = __input.len();
20878 let mut payload_buf = [0; Self::ENCODED_LEN];
20879 let mut buf = if avail_len < Self::ENCODED_LEN {
20880 payload_buf[0..avail_len].copy_from_slice(__input);
20881 Bytes::new(&payload_buf)
20882 } else {
20883 Bytes::new(__input)
20884 };
20885 let mut __struct = Self::default();
20886 __struct.time_usec = buf.get_u64_le();
20887 __struct.flow_comp_m_x = buf.get_f32_le();
20888 __struct.flow_comp_m_y = buf.get_f32_le();
20889 __struct.ground_distance = buf.get_f32_le();
20890 __struct.flow_x = buf.get_i16_le();
20891 __struct.flow_y = buf.get_i16_le();
20892 __struct.sensor_id = buf.get_u8();
20893 __struct.quality = buf.get_u8();
20894 __struct.flow_rate_x = buf.get_f32_le();
20895 __struct.flow_rate_y = buf.get_f32_le();
20896 Ok(__struct)
20897 }
20898 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20899 let mut __tmp = BytesMut::new(bytes);
20900 #[allow(clippy::absurd_extreme_comparisons)]
20901 #[allow(unused_comparisons)]
20902 if __tmp.remaining() < Self::ENCODED_LEN {
20903 panic!(
20904 "buffer is too small (need {} bytes, but got {})",
20905 Self::ENCODED_LEN,
20906 __tmp.remaining(),
20907 )
20908 }
20909 __tmp.put_u64_le(self.time_usec);
20910 __tmp.put_f32_le(self.flow_comp_m_x);
20911 __tmp.put_f32_le(self.flow_comp_m_y);
20912 __tmp.put_f32_le(self.ground_distance);
20913 __tmp.put_i16_le(self.flow_x);
20914 __tmp.put_i16_le(self.flow_y);
20915 __tmp.put_u8(self.sensor_id);
20916 __tmp.put_u8(self.quality);
20917 __tmp.put_f32_le(self.flow_rate_x);
20918 __tmp.put_f32_le(self.flow_rate_y);
20919 if matches!(version, MavlinkVersion::V2) {
20920 let len = __tmp.len();
20921 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20922 } else {
20923 __tmp.len()
20924 }
20925 }
20926}
20927#[doc = "id: 310"]
20928#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
20929#[derive(Debug, Clone, PartialEq)]
20930#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20931#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20932pub struct UAVCAN_NODE_STATUS_DATA {
20933 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20934 pub time_usec: u64,
20935 #[doc = "Time since the start-up of the node."]
20936 pub uptime_sec: u32,
20937 #[doc = "Vendor-specific status information."]
20938 pub vendor_specific_status_code: u16,
20939 #[doc = "Generalized node health status."]
20940 pub health: UavcanNodeHealth,
20941 #[doc = "Generalized operating mode."]
20942 pub mode: UavcanNodeMode,
20943 #[doc = "Not used currently."]
20944 pub sub_mode: u8,
20945}
20946impl UAVCAN_NODE_STATUS_DATA {
20947 pub const ENCODED_LEN: usize = 17usize;
20948 pub const DEFAULT: Self = Self {
20949 time_usec: 0_u64,
20950 uptime_sec: 0_u32,
20951 vendor_specific_status_code: 0_u16,
20952 health: UavcanNodeHealth::DEFAULT,
20953 mode: UavcanNodeMode::DEFAULT,
20954 sub_mode: 0_u8,
20955 };
20956 #[cfg(feature = "arbitrary")]
20957 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20958 use arbitrary::{Arbitrary, Unstructured};
20959 let mut buf = [0u8; 1024];
20960 rng.fill_bytes(&mut buf);
20961 let mut unstructured = Unstructured::new(&buf);
20962 Self::arbitrary(&mut unstructured).unwrap_or_default()
20963 }
20964}
20965impl Default for UAVCAN_NODE_STATUS_DATA {
20966 fn default() -> Self {
20967 Self::DEFAULT.clone()
20968 }
20969}
20970impl MessageData for UAVCAN_NODE_STATUS_DATA {
20971 type Message = MavMessage;
20972 const ID: u32 = 310u32;
20973 const NAME: &'static str = "UAVCAN_NODE_STATUS";
20974 const EXTRA_CRC: u8 = 28u8;
20975 const ENCODED_LEN: usize = 17usize;
20976 fn deser(
20977 _version: MavlinkVersion,
20978 __input: &[u8],
20979 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20980 let avail_len = __input.len();
20981 let mut payload_buf = [0; Self::ENCODED_LEN];
20982 let mut buf = if avail_len < Self::ENCODED_LEN {
20983 payload_buf[0..avail_len].copy_from_slice(__input);
20984 Bytes::new(&payload_buf)
20985 } else {
20986 Bytes::new(__input)
20987 };
20988 let mut __struct = Self::default();
20989 __struct.time_usec = buf.get_u64_le();
20990 __struct.uptime_sec = buf.get_u32_le();
20991 __struct.vendor_specific_status_code = buf.get_u16_le();
20992 let tmp = buf.get_u8();
20993 __struct.health =
20994 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20995 enum_type: "UavcanNodeHealth",
20996 value: tmp as u32,
20997 })?;
20998 let tmp = buf.get_u8();
20999 __struct.mode =
21000 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21001 enum_type: "UavcanNodeMode",
21002 value: tmp as u32,
21003 })?;
21004 __struct.sub_mode = buf.get_u8();
21005 Ok(__struct)
21006 }
21007 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21008 let mut __tmp = BytesMut::new(bytes);
21009 #[allow(clippy::absurd_extreme_comparisons)]
21010 #[allow(unused_comparisons)]
21011 if __tmp.remaining() < Self::ENCODED_LEN {
21012 panic!(
21013 "buffer is too small (need {} bytes, but got {})",
21014 Self::ENCODED_LEN,
21015 __tmp.remaining(),
21016 )
21017 }
21018 __tmp.put_u64_le(self.time_usec);
21019 __tmp.put_u32_le(self.uptime_sec);
21020 __tmp.put_u16_le(self.vendor_specific_status_code);
21021 __tmp.put_u8(self.health as u8);
21022 __tmp.put_u8(self.mode as u8);
21023 __tmp.put_u8(self.sub_mode);
21024 if matches!(version, MavlinkVersion::V2) {
21025 let len = __tmp.len();
21026 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21027 } else {
21028 __tmp.len()
21029 }
21030 }
21031}
21032#[doc = "id: 89"]
21033#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
21034#[derive(Debug, Clone, PartialEq)]
21035#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21036#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21037pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
21038 #[doc = "Timestamp (time since system boot)."]
21039 pub time_boot_ms: u32,
21040 #[doc = "X Position"]
21041 pub x: f32,
21042 #[doc = "Y Position"]
21043 pub y: f32,
21044 #[doc = "Z Position"]
21045 pub z: f32,
21046 #[doc = "Roll"]
21047 pub roll: f32,
21048 #[doc = "Pitch"]
21049 pub pitch: f32,
21050 #[doc = "Yaw"]
21051 pub yaw: f32,
21052}
21053impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
21054 pub const ENCODED_LEN: usize = 28usize;
21055 pub const DEFAULT: Self = Self {
21056 time_boot_ms: 0_u32,
21057 x: 0.0_f32,
21058 y: 0.0_f32,
21059 z: 0.0_f32,
21060 roll: 0.0_f32,
21061 pitch: 0.0_f32,
21062 yaw: 0.0_f32,
21063 };
21064 #[cfg(feature = "arbitrary")]
21065 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21066 use arbitrary::{Arbitrary, Unstructured};
21067 let mut buf = [0u8; 1024];
21068 rng.fill_bytes(&mut buf);
21069 let mut unstructured = Unstructured::new(&buf);
21070 Self::arbitrary(&mut unstructured).unwrap_or_default()
21071 }
21072}
21073impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
21074 fn default() -> Self {
21075 Self::DEFAULT.clone()
21076 }
21077}
21078impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
21079 type Message = MavMessage;
21080 const ID: u32 = 89u32;
21081 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
21082 const EXTRA_CRC: u8 = 231u8;
21083 const ENCODED_LEN: usize = 28usize;
21084 fn deser(
21085 _version: MavlinkVersion,
21086 __input: &[u8],
21087 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21088 let avail_len = __input.len();
21089 let mut payload_buf = [0; Self::ENCODED_LEN];
21090 let mut buf = if avail_len < Self::ENCODED_LEN {
21091 payload_buf[0..avail_len].copy_from_slice(__input);
21092 Bytes::new(&payload_buf)
21093 } else {
21094 Bytes::new(__input)
21095 };
21096 let mut __struct = Self::default();
21097 __struct.time_boot_ms = buf.get_u32_le();
21098 __struct.x = buf.get_f32_le();
21099 __struct.y = buf.get_f32_le();
21100 __struct.z = buf.get_f32_le();
21101 __struct.roll = buf.get_f32_le();
21102 __struct.pitch = buf.get_f32_le();
21103 __struct.yaw = buf.get_f32_le();
21104 Ok(__struct)
21105 }
21106 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21107 let mut __tmp = BytesMut::new(bytes);
21108 #[allow(clippy::absurd_extreme_comparisons)]
21109 #[allow(unused_comparisons)]
21110 if __tmp.remaining() < Self::ENCODED_LEN {
21111 panic!(
21112 "buffer is too small (need {} bytes, but got {})",
21113 Self::ENCODED_LEN,
21114 __tmp.remaining(),
21115 )
21116 }
21117 __tmp.put_u32_le(self.time_boot_ms);
21118 __tmp.put_f32_le(self.x);
21119 __tmp.put_f32_le(self.y);
21120 __tmp.put_f32_le(self.z);
21121 __tmp.put_f32_le(self.roll);
21122 __tmp.put_f32_le(self.pitch);
21123 __tmp.put_f32_le(self.yaw);
21124 if matches!(version, MavlinkVersion::V2) {
21125 let len = __tmp.len();
21126 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21127 } else {
21128 __tmp.len()
21129 }
21130 }
21131}
21132#[doc = "id: 42"]
21133#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
21134#[derive(Debug, Clone, PartialEq)]
21135#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21136#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21137pub struct MISSION_CURRENT_DATA {
21138 #[doc = "Sequence"]
21139 pub seq: u16,
21140 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
21141 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21142 pub total: u16,
21143 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
21144 #[cfg_attr(feature = "serde", serde(default))]
21145 pub mission_state: MissionState,
21146 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
21147 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21148 pub mission_mode: u8,
21149 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
21150 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21151 pub mission_id: u32,
21152 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
21153 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21154 pub fence_id: u32,
21155 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
21156 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21157 pub rally_points_id: u32,
21158}
21159impl MISSION_CURRENT_DATA {
21160 pub const ENCODED_LEN: usize = 18usize;
21161 pub const DEFAULT: Self = Self {
21162 seq: 0_u16,
21163 total: 0_u16,
21164 mission_state: MissionState::DEFAULT,
21165 mission_mode: 0_u8,
21166 mission_id: 0_u32,
21167 fence_id: 0_u32,
21168 rally_points_id: 0_u32,
21169 };
21170 #[cfg(feature = "arbitrary")]
21171 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21172 use arbitrary::{Arbitrary, Unstructured};
21173 let mut buf = [0u8; 1024];
21174 rng.fill_bytes(&mut buf);
21175 let mut unstructured = Unstructured::new(&buf);
21176 Self::arbitrary(&mut unstructured).unwrap_or_default()
21177 }
21178}
21179impl Default for MISSION_CURRENT_DATA {
21180 fn default() -> Self {
21181 Self::DEFAULT.clone()
21182 }
21183}
21184impl MessageData for MISSION_CURRENT_DATA {
21185 type Message = MavMessage;
21186 const ID: u32 = 42u32;
21187 const NAME: &'static str = "MISSION_CURRENT";
21188 const EXTRA_CRC: u8 = 28u8;
21189 const ENCODED_LEN: usize = 18usize;
21190 fn deser(
21191 _version: MavlinkVersion,
21192 __input: &[u8],
21193 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21194 let avail_len = __input.len();
21195 let mut payload_buf = [0; Self::ENCODED_LEN];
21196 let mut buf = if avail_len < Self::ENCODED_LEN {
21197 payload_buf[0..avail_len].copy_from_slice(__input);
21198 Bytes::new(&payload_buf)
21199 } else {
21200 Bytes::new(__input)
21201 };
21202 let mut __struct = Self::default();
21203 __struct.seq = buf.get_u16_le();
21204 __struct.total = buf.get_u16_le();
21205 let tmp = buf.get_u8();
21206 __struct.mission_state =
21207 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21208 enum_type: "MissionState",
21209 value: tmp as u32,
21210 })?;
21211 __struct.mission_mode = buf.get_u8();
21212 __struct.mission_id = buf.get_u32_le();
21213 __struct.fence_id = buf.get_u32_le();
21214 __struct.rally_points_id = buf.get_u32_le();
21215 Ok(__struct)
21216 }
21217 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21218 let mut __tmp = BytesMut::new(bytes);
21219 #[allow(clippy::absurd_extreme_comparisons)]
21220 #[allow(unused_comparisons)]
21221 if __tmp.remaining() < Self::ENCODED_LEN {
21222 panic!(
21223 "buffer is too small (need {} bytes, but got {})",
21224 Self::ENCODED_LEN,
21225 __tmp.remaining(),
21226 )
21227 }
21228 __tmp.put_u16_le(self.seq);
21229 __tmp.put_u16_le(self.total);
21230 __tmp.put_u8(self.mission_state as u8);
21231 __tmp.put_u8(self.mission_mode);
21232 __tmp.put_u32_le(self.mission_id);
21233 __tmp.put_u32_le(self.fence_id);
21234 __tmp.put_u32_le(self.rally_points_id);
21235 if matches!(version, MavlinkVersion::V2) {
21236 let len = __tmp.len();
21237 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21238 } else {
21239 __tmp.len()
21240 }
21241 }
21242}
21243#[doc = "id: 245"]
21244#[doc = "Provides state for additional features."]
21245#[derive(Debug, Clone, PartialEq)]
21246#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21247#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21248pub struct EXTENDED_SYS_STATE_DATA {
21249 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
21250 pub vtol_state: MavVtolState,
21251 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
21252 pub landed_state: MavLandedState,
21253}
21254impl EXTENDED_SYS_STATE_DATA {
21255 pub const ENCODED_LEN: usize = 2usize;
21256 pub const DEFAULT: Self = Self {
21257 vtol_state: MavVtolState::DEFAULT,
21258 landed_state: MavLandedState::DEFAULT,
21259 };
21260 #[cfg(feature = "arbitrary")]
21261 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21262 use arbitrary::{Arbitrary, Unstructured};
21263 let mut buf = [0u8; 1024];
21264 rng.fill_bytes(&mut buf);
21265 let mut unstructured = Unstructured::new(&buf);
21266 Self::arbitrary(&mut unstructured).unwrap_or_default()
21267 }
21268}
21269impl Default for EXTENDED_SYS_STATE_DATA {
21270 fn default() -> Self {
21271 Self::DEFAULT.clone()
21272 }
21273}
21274impl MessageData for EXTENDED_SYS_STATE_DATA {
21275 type Message = MavMessage;
21276 const ID: u32 = 245u32;
21277 const NAME: &'static str = "EXTENDED_SYS_STATE";
21278 const EXTRA_CRC: u8 = 130u8;
21279 const ENCODED_LEN: usize = 2usize;
21280 fn deser(
21281 _version: MavlinkVersion,
21282 __input: &[u8],
21283 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21284 let avail_len = __input.len();
21285 let mut payload_buf = [0; Self::ENCODED_LEN];
21286 let mut buf = if avail_len < Self::ENCODED_LEN {
21287 payload_buf[0..avail_len].copy_from_slice(__input);
21288 Bytes::new(&payload_buf)
21289 } else {
21290 Bytes::new(__input)
21291 };
21292 let mut __struct = Self::default();
21293 let tmp = buf.get_u8();
21294 __struct.vtol_state =
21295 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21296 enum_type: "MavVtolState",
21297 value: tmp as u32,
21298 })?;
21299 let tmp = buf.get_u8();
21300 __struct.landed_state =
21301 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21302 enum_type: "MavLandedState",
21303 value: tmp as u32,
21304 })?;
21305 Ok(__struct)
21306 }
21307 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21308 let mut __tmp = BytesMut::new(bytes);
21309 #[allow(clippy::absurd_extreme_comparisons)]
21310 #[allow(unused_comparisons)]
21311 if __tmp.remaining() < Self::ENCODED_LEN {
21312 panic!(
21313 "buffer is too small (need {} bytes, but got {})",
21314 Self::ENCODED_LEN,
21315 __tmp.remaining(),
21316 )
21317 }
21318 __tmp.put_u8(self.vtol_state as u8);
21319 __tmp.put_u8(self.landed_state as u8);
21320 if matches!(version, MavlinkVersion::V2) {
21321 let len = __tmp.len();
21322 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21323 } else {
21324 __tmp.len()
21325 }
21326 }
21327}
21328#[doc = "id: 119"]
21329#[doc = "Request a chunk of a log."]
21330#[derive(Debug, Clone, PartialEq)]
21331#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21332#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21333pub struct LOG_REQUEST_DATA_DATA {
21334 #[doc = "Offset into the log"]
21335 pub ofs: u32,
21336 #[doc = "Number of bytes"]
21337 pub count: u32,
21338 #[doc = "Log id (from LOG_ENTRY reply)"]
21339 pub id: u16,
21340 #[doc = "System ID"]
21341 pub target_system: u8,
21342 #[doc = "Component ID"]
21343 pub target_component: u8,
21344}
21345impl LOG_REQUEST_DATA_DATA {
21346 pub const ENCODED_LEN: usize = 12usize;
21347 pub const DEFAULT: Self = Self {
21348 ofs: 0_u32,
21349 count: 0_u32,
21350 id: 0_u16,
21351 target_system: 0_u8,
21352 target_component: 0_u8,
21353 };
21354 #[cfg(feature = "arbitrary")]
21355 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21356 use arbitrary::{Arbitrary, Unstructured};
21357 let mut buf = [0u8; 1024];
21358 rng.fill_bytes(&mut buf);
21359 let mut unstructured = Unstructured::new(&buf);
21360 Self::arbitrary(&mut unstructured).unwrap_or_default()
21361 }
21362}
21363impl Default for LOG_REQUEST_DATA_DATA {
21364 fn default() -> Self {
21365 Self::DEFAULT.clone()
21366 }
21367}
21368impl MessageData for LOG_REQUEST_DATA_DATA {
21369 type Message = MavMessage;
21370 const ID: u32 = 119u32;
21371 const NAME: &'static str = "LOG_REQUEST_DATA";
21372 const EXTRA_CRC: u8 = 116u8;
21373 const ENCODED_LEN: usize = 12usize;
21374 fn deser(
21375 _version: MavlinkVersion,
21376 __input: &[u8],
21377 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21378 let avail_len = __input.len();
21379 let mut payload_buf = [0; Self::ENCODED_LEN];
21380 let mut buf = if avail_len < Self::ENCODED_LEN {
21381 payload_buf[0..avail_len].copy_from_slice(__input);
21382 Bytes::new(&payload_buf)
21383 } else {
21384 Bytes::new(__input)
21385 };
21386 let mut __struct = Self::default();
21387 __struct.ofs = buf.get_u32_le();
21388 __struct.count = buf.get_u32_le();
21389 __struct.id = buf.get_u16_le();
21390 __struct.target_system = buf.get_u8();
21391 __struct.target_component = buf.get_u8();
21392 Ok(__struct)
21393 }
21394 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21395 let mut __tmp = BytesMut::new(bytes);
21396 #[allow(clippy::absurd_extreme_comparisons)]
21397 #[allow(unused_comparisons)]
21398 if __tmp.remaining() < Self::ENCODED_LEN {
21399 panic!(
21400 "buffer is too small (need {} bytes, but got {})",
21401 Self::ENCODED_LEN,
21402 __tmp.remaining(),
21403 )
21404 }
21405 __tmp.put_u32_le(self.ofs);
21406 __tmp.put_u32_le(self.count);
21407 __tmp.put_u16_le(self.id);
21408 __tmp.put_u8(self.target_system);
21409 __tmp.put_u8(self.target_component);
21410 if matches!(version, MavlinkVersion::V2) {
21411 let len = __tmp.len();
21412 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21413 } else {
21414 __tmp.len()
21415 }
21416 }
21417}
21418#[doc = "id: 244"]
21419#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
21420#[derive(Debug, Clone, PartialEq)]
21421#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21422#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21423pub struct MESSAGE_INTERVAL_DATA {
21424 #[doc = "0 indicates the interval at which it is sent."]
21425 pub interval_us: i32,
21426 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
21427 pub message_id: u16,
21428}
21429impl MESSAGE_INTERVAL_DATA {
21430 pub const ENCODED_LEN: usize = 6usize;
21431 pub const DEFAULT: Self = Self {
21432 interval_us: 0_i32,
21433 message_id: 0_u16,
21434 };
21435 #[cfg(feature = "arbitrary")]
21436 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21437 use arbitrary::{Arbitrary, Unstructured};
21438 let mut buf = [0u8; 1024];
21439 rng.fill_bytes(&mut buf);
21440 let mut unstructured = Unstructured::new(&buf);
21441 Self::arbitrary(&mut unstructured).unwrap_or_default()
21442 }
21443}
21444impl Default for MESSAGE_INTERVAL_DATA {
21445 fn default() -> Self {
21446 Self::DEFAULT.clone()
21447 }
21448}
21449impl MessageData for MESSAGE_INTERVAL_DATA {
21450 type Message = MavMessage;
21451 const ID: u32 = 244u32;
21452 const NAME: &'static str = "MESSAGE_INTERVAL";
21453 const EXTRA_CRC: u8 = 95u8;
21454 const ENCODED_LEN: usize = 6usize;
21455 fn deser(
21456 _version: MavlinkVersion,
21457 __input: &[u8],
21458 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21459 let avail_len = __input.len();
21460 let mut payload_buf = [0; Self::ENCODED_LEN];
21461 let mut buf = if avail_len < Self::ENCODED_LEN {
21462 payload_buf[0..avail_len].copy_from_slice(__input);
21463 Bytes::new(&payload_buf)
21464 } else {
21465 Bytes::new(__input)
21466 };
21467 let mut __struct = Self::default();
21468 __struct.interval_us = buf.get_i32_le();
21469 __struct.message_id = buf.get_u16_le();
21470 Ok(__struct)
21471 }
21472 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21473 let mut __tmp = BytesMut::new(bytes);
21474 #[allow(clippy::absurd_extreme_comparisons)]
21475 #[allow(unused_comparisons)]
21476 if __tmp.remaining() < Self::ENCODED_LEN {
21477 panic!(
21478 "buffer is too small (need {} bytes, but got {})",
21479 Self::ENCODED_LEN,
21480 __tmp.remaining(),
21481 )
21482 }
21483 __tmp.put_i32_le(self.interval_us);
21484 __tmp.put_u16_le(self.message_id);
21485 if matches!(version, MavlinkVersion::V2) {
21486 let len = __tmp.len();
21487 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21488 } else {
21489 __tmp.len()
21490 }
21491 }
21492}
21493#[doc = "id: 388"]
21494#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
21495#[derive(Debug, Clone, PartialEq)]
21496#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21497#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21498pub struct CAN_FILTER_MODIFY_DATA {
21499 #[doc = "filter IDs, length num_ids"]
21500 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21501 pub ids: [u16; 16],
21502 #[doc = "System ID."]
21503 pub target_system: u8,
21504 #[doc = "Component ID."]
21505 pub target_component: u8,
21506 #[doc = "bus number"]
21507 pub bus: u8,
21508 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
21509 pub operation: CanFilterOp,
21510 #[doc = "number of IDs in filter list"]
21511 pub num_ids: u8,
21512}
21513impl CAN_FILTER_MODIFY_DATA {
21514 pub const ENCODED_LEN: usize = 37usize;
21515 pub const DEFAULT: Self = Self {
21516 ids: [0_u16; 16usize],
21517 target_system: 0_u8,
21518 target_component: 0_u8,
21519 bus: 0_u8,
21520 operation: CanFilterOp::DEFAULT,
21521 num_ids: 0_u8,
21522 };
21523 #[cfg(feature = "arbitrary")]
21524 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21525 use arbitrary::{Arbitrary, Unstructured};
21526 let mut buf = [0u8; 1024];
21527 rng.fill_bytes(&mut buf);
21528 let mut unstructured = Unstructured::new(&buf);
21529 Self::arbitrary(&mut unstructured).unwrap_or_default()
21530 }
21531}
21532impl Default for CAN_FILTER_MODIFY_DATA {
21533 fn default() -> Self {
21534 Self::DEFAULT.clone()
21535 }
21536}
21537impl MessageData for CAN_FILTER_MODIFY_DATA {
21538 type Message = MavMessage;
21539 const ID: u32 = 388u32;
21540 const NAME: &'static str = "CAN_FILTER_MODIFY";
21541 const EXTRA_CRC: u8 = 8u8;
21542 const ENCODED_LEN: usize = 37usize;
21543 fn deser(
21544 _version: MavlinkVersion,
21545 __input: &[u8],
21546 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21547 let avail_len = __input.len();
21548 let mut payload_buf = [0; Self::ENCODED_LEN];
21549 let mut buf = if avail_len < Self::ENCODED_LEN {
21550 payload_buf[0..avail_len].copy_from_slice(__input);
21551 Bytes::new(&payload_buf)
21552 } else {
21553 Bytes::new(__input)
21554 };
21555 let mut __struct = Self::default();
21556 for v in &mut __struct.ids {
21557 let val = buf.get_u16_le();
21558 *v = val;
21559 }
21560 __struct.target_system = buf.get_u8();
21561 __struct.target_component = buf.get_u8();
21562 __struct.bus = buf.get_u8();
21563 let tmp = buf.get_u8();
21564 __struct.operation =
21565 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21566 enum_type: "CanFilterOp",
21567 value: tmp as u32,
21568 })?;
21569 __struct.num_ids = buf.get_u8();
21570 Ok(__struct)
21571 }
21572 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21573 let mut __tmp = BytesMut::new(bytes);
21574 #[allow(clippy::absurd_extreme_comparisons)]
21575 #[allow(unused_comparisons)]
21576 if __tmp.remaining() < Self::ENCODED_LEN {
21577 panic!(
21578 "buffer is too small (need {} bytes, but got {})",
21579 Self::ENCODED_LEN,
21580 __tmp.remaining(),
21581 )
21582 }
21583 for val in &self.ids {
21584 __tmp.put_u16_le(*val);
21585 }
21586 __tmp.put_u8(self.target_system);
21587 __tmp.put_u8(self.target_component);
21588 __tmp.put_u8(self.bus);
21589 __tmp.put_u8(self.operation as u8);
21590 __tmp.put_u8(self.num_ids);
21591 if matches!(version, MavlinkVersion::V2) {
21592 let len = __tmp.len();
21593 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21594 } else {
21595 __tmp.len()
21596 }
21597 }
21598}
21599#[doc = "id: 80"]
21600#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
21601#[derive(Debug, Clone, PartialEq)]
21602#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21603#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21604pub struct COMMAND_CANCEL_DATA {
21605 #[doc = "Command ID (of command to cancel)."]
21606 pub command: MavCmd,
21607 #[doc = "System executing long running command. Should not be broadcast (0)."]
21608 pub target_system: u8,
21609 #[doc = "Component executing long running command."]
21610 pub target_component: u8,
21611}
21612impl COMMAND_CANCEL_DATA {
21613 pub const ENCODED_LEN: usize = 4usize;
21614 pub const DEFAULT: Self = Self {
21615 command: MavCmd::DEFAULT,
21616 target_system: 0_u8,
21617 target_component: 0_u8,
21618 };
21619 #[cfg(feature = "arbitrary")]
21620 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21621 use arbitrary::{Arbitrary, Unstructured};
21622 let mut buf = [0u8; 1024];
21623 rng.fill_bytes(&mut buf);
21624 let mut unstructured = Unstructured::new(&buf);
21625 Self::arbitrary(&mut unstructured).unwrap_or_default()
21626 }
21627}
21628impl Default for COMMAND_CANCEL_DATA {
21629 fn default() -> Self {
21630 Self::DEFAULT.clone()
21631 }
21632}
21633impl MessageData for COMMAND_CANCEL_DATA {
21634 type Message = MavMessage;
21635 const ID: u32 = 80u32;
21636 const NAME: &'static str = "COMMAND_CANCEL";
21637 const EXTRA_CRC: u8 = 14u8;
21638 const ENCODED_LEN: usize = 4usize;
21639 fn deser(
21640 _version: MavlinkVersion,
21641 __input: &[u8],
21642 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21643 let avail_len = __input.len();
21644 let mut payload_buf = [0; Self::ENCODED_LEN];
21645 let mut buf = if avail_len < Self::ENCODED_LEN {
21646 payload_buf[0..avail_len].copy_from_slice(__input);
21647 Bytes::new(&payload_buf)
21648 } else {
21649 Bytes::new(__input)
21650 };
21651 let mut __struct = Self::default();
21652 let tmp = buf.get_u16_le();
21653 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
21654 ::mavlink_core::error::ParserError::InvalidEnum {
21655 enum_type: "MavCmd",
21656 value: tmp as u32,
21657 },
21658 )?;
21659 __struct.target_system = buf.get_u8();
21660 __struct.target_component = buf.get_u8();
21661 Ok(__struct)
21662 }
21663 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21664 let mut __tmp = BytesMut::new(bytes);
21665 #[allow(clippy::absurd_extreme_comparisons)]
21666 #[allow(unused_comparisons)]
21667 if __tmp.remaining() < Self::ENCODED_LEN {
21668 panic!(
21669 "buffer is too small (need {} bytes, but got {})",
21670 Self::ENCODED_LEN,
21671 __tmp.remaining(),
21672 )
21673 }
21674 __tmp.put_u16_le(self.command as u16);
21675 __tmp.put_u8(self.target_system);
21676 __tmp.put_u8(self.target_component);
21677 if matches!(version, MavlinkVersion::V2) {
21678 let len = __tmp.len();
21679 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21680 } else {
21681 __tmp.len()
21682 }
21683 }
21684}
21685#[doc = "id: 276"]
21686#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
21687#[derive(Debug, Clone, PartialEq)]
21688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21689#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21690pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
21691 #[doc = "Latitude of tracked object"]
21692 pub lat: i32,
21693 #[doc = "Longitude of tracked object"]
21694 pub lon: i32,
21695 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
21696 pub alt: f32,
21697 #[doc = "Horizontal accuracy. NAN if unknown"]
21698 pub h_acc: f32,
21699 #[doc = "Vertical accuracy. NAN if unknown"]
21700 pub v_acc: f32,
21701 #[doc = "North velocity of tracked object. NAN if unknown"]
21702 pub vel_n: f32,
21703 #[doc = "East velocity of tracked object. NAN if unknown"]
21704 pub vel_e: f32,
21705 #[doc = "Down velocity of tracked object. NAN if unknown"]
21706 pub vel_d: f32,
21707 #[doc = "Velocity accuracy. NAN if unknown"]
21708 pub vel_acc: f32,
21709 #[doc = "Distance between camera and tracked object. NAN if unknown"]
21710 pub dist: f32,
21711 #[doc = "Heading in radians, in NED. NAN if unknown"]
21712 pub hdg: f32,
21713 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
21714 pub hdg_acc: f32,
21715 #[doc = "Current tracking status"]
21716 pub tracking_status: CameraTrackingStatusFlags,
21717 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
21718 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
21719 pub camera_device_id: u8,
21720}
21721impl CAMERA_TRACKING_GEO_STATUS_DATA {
21722 pub const ENCODED_LEN: usize = 50usize;
21723 pub const DEFAULT: Self = Self {
21724 lat: 0_i32,
21725 lon: 0_i32,
21726 alt: 0.0_f32,
21727 h_acc: 0.0_f32,
21728 v_acc: 0.0_f32,
21729 vel_n: 0.0_f32,
21730 vel_e: 0.0_f32,
21731 vel_d: 0.0_f32,
21732 vel_acc: 0.0_f32,
21733 dist: 0.0_f32,
21734 hdg: 0.0_f32,
21735 hdg_acc: 0.0_f32,
21736 tracking_status: CameraTrackingStatusFlags::DEFAULT,
21737 camera_device_id: 0_u8,
21738 };
21739 #[cfg(feature = "arbitrary")]
21740 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21741 use arbitrary::{Arbitrary, Unstructured};
21742 let mut buf = [0u8; 1024];
21743 rng.fill_bytes(&mut buf);
21744 let mut unstructured = Unstructured::new(&buf);
21745 Self::arbitrary(&mut unstructured).unwrap_or_default()
21746 }
21747}
21748impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
21749 fn default() -> Self {
21750 Self::DEFAULT.clone()
21751 }
21752}
21753impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
21754 type Message = MavMessage;
21755 const ID: u32 = 276u32;
21756 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
21757 const EXTRA_CRC: u8 = 18u8;
21758 const ENCODED_LEN: usize = 50usize;
21759 fn deser(
21760 _version: MavlinkVersion,
21761 __input: &[u8],
21762 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21763 let avail_len = __input.len();
21764 let mut payload_buf = [0; Self::ENCODED_LEN];
21765 let mut buf = if avail_len < Self::ENCODED_LEN {
21766 payload_buf[0..avail_len].copy_from_slice(__input);
21767 Bytes::new(&payload_buf)
21768 } else {
21769 Bytes::new(__input)
21770 };
21771 let mut __struct = Self::default();
21772 __struct.lat = buf.get_i32_le();
21773 __struct.lon = buf.get_i32_le();
21774 __struct.alt = buf.get_f32_le();
21775 __struct.h_acc = buf.get_f32_le();
21776 __struct.v_acc = buf.get_f32_le();
21777 __struct.vel_n = buf.get_f32_le();
21778 __struct.vel_e = buf.get_f32_le();
21779 __struct.vel_d = buf.get_f32_le();
21780 __struct.vel_acc = buf.get_f32_le();
21781 __struct.dist = buf.get_f32_le();
21782 __struct.hdg = buf.get_f32_le();
21783 __struct.hdg_acc = buf.get_f32_le();
21784 let tmp = buf.get_u8();
21785 __struct.tracking_status =
21786 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21787 enum_type: "CameraTrackingStatusFlags",
21788 value: tmp as u32,
21789 })?;
21790 __struct.camera_device_id = buf.get_u8();
21791 Ok(__struct)
21792 }
21793 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21794 let mut __tmp = BytesMut::new(bytes);
21795 #[allow(clippy::absurd_extreme_comparisons)]
21796 #[allow(unused_comparisons)]
21797 if __tmp.remaining() < Self::ENCODED_LEN {
21798 panic!(
21799 "buffer is too small (need {} bytes, but got {})",
21800 Self::ENCODED_LEN,
21801 __tmp.remaining(),
21802 )
21803 }
21804 __tmp.put_i32_le(self.lat);
21805 __tmp.put_i32_le(self.lon);
21806 __tmp.put_f32_le(self.alt);
21807 __tmp.put_f32_le(self.h_acc);
21808 __tmp.put_f32_le(self.v_acc);
21809 __tmp.put_f32_le(self.vel_n);
21810 __tmp.put_f32_le(self.vel_e);
21811 __tmp.put_f32_le(self.vel_d);
21812 __tmp.put_f32_le(self.vel_acc);
21813 __tmp.put_f32_le(self.dist);
21814 __tmp.put_f32_le(self.hdg);
21815 __tmp.put_f32_le(self.hdg_acc);
21816 __tmp.put_u8(self.tracking_status as u8);
21817 __tmp.put_u8(self.camera_device_id);
21818 if matches!(version, MavlinkVersion::V2) {
21819 let len = __tmp.len();
21820 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21821 } else {
21822 __tmp.len()
21823 }
21824 }
21825}
21826#[doc = "id: 123"]
21827#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
21828#[derive(Debug, Clone, PartialEq)]
21829#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21830#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21831pub struct GPS_INJECT_DATA_DATA {
21832 #[doc = "System ID"]
21833 pub target_system: u8,
21834 #[doc = "Component ID"]
21835 pub target_component: u8,
21836 #[doc = "Data length"]
21837 pub len: u8,
21838 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
21839 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21840 pub data: [u8; 110],
21841}
21842impl GPS_INJECT_DATA_DATA {
21843 pub const ENCODED_LEN: usize = 113usize;
21844 pub const DEFAULT: Self = Self {
21845 target_system: 0_u8,
21846 target_component: 0_u8,
21847 len: 0_u8,
21848 data: [0_u8; 110usize],
21849 };
21850 #[cfg(feature = "arbitrary")]
21851 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21852 use arbitrary::{Arbitrary, Unstructured};
21853 let mut buf = [0u8; 1024];
21854 rng.fill_bytes(&mut buf);
21855 let mut unstructured = Unstructured::new(&buf);
21856 Self::arbitrary(&mut unstructured).unwrap_or_default()
21857 }
21858}
21859impl Default for GPS_INJECT_DATA_DATA {
21860 fn default() -> Self {
21861 Self::DEFAULT.clone()
21862 }
21863}
21864impl MessageData for GPS_INJECT_DATA_DATA {
21865 type Message = MavMessage;
21866 const ID: u32 = 123u32;
21867 const NAME: &'static str = "GPS_INJECT_DATA";
21868 const EXTRA_CRC: u8 = 250u8;
21869 const ENCODED_LEN: usize = 113usize;
21870 fn deser(
21871 _version: MavlinkVersion,
21872 __input: &[u8],
21873 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21874 let avail_len = __input.len();
21875 let mut payload_buf = [0; Self::ENCODED_LEN];
21876 let mut buf = if avail_len < Self::ENCODED_LEN {
21877 payload_buf[0..avail_len].copy_from_slice(__input);
21878 Bytes::new(&payload_buf)
21879 } else {
21880 Bytes::new(__input)
21881 };
21882 let mut __struct = Self::default();
21883 __struct.target_system = buf.get_u8();
21884 __struct.target_component = buf.get_u8();
21885 __struct.len = buf.get_u8();
21886 for v in &mut __struct.data {
21887 let val = buf.get_u8();
21888 *v = val;
21889 }
21890 Ok(__struct)
21891 }
21892 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21893 let mut __tmp = BytesMut::new(bytes);
21894 #[allow(clippy::absurd_extreme_comparisons)]
21895 #[allow(unused_comparisons)]
21896 if __tmp.remaining() < Self::ENCODED_LEN {
21897 panic!(
21898 "buffer is too small (need {} bytes, but got {})",
21899 Self::ENCODED_LEN,
21900 __tmp.remaining(),
21901 )
21902 }
21903 __tmp.put_u8(self.target_system);
21904 __tmp.put_u8(self.target_component);
21905 __tmp.put_u8(self.len);
21906 for val in &self.data {
21907 __tmp.put_u8(*val);
21908 }
21909 if matches!(version, MavlinkVersion::V2) {
21910 let len = __tmp.len();
21911 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21912 } else {
21913 __tmp.len()
21914 }
21915 }
21916}
21917#[doc = "id: 128"]
21918#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
21919#[derive(Debug, Clone, PartialEq)]
21920#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21921#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21922pub struct GPS2_RTK_DATA {
21923 #[doc = "Time since boot of last baseline message received."]
21924 pub time_last_baseline_ms: u32,
21925 #[doc = "GPS Time of Week of last baseline"]
21926 pub tow: u32,
21927 #[doc = "Current baseline in ECEF x or NED north component."]
21928 pub baseline_a_mm: i32,
21929 #[doc = "Current baseline in ECEF y or NED east component."]
21930 pub baseline_b_mm: i32,
21931 #[doc = "Current baseline in ECEF z or NED down component."]
21932 pub baseline_c_mm: i32,
21933 #[doc = "Current estimate of baseline accuracy."]
21934 pub accuracy: u32,
21935 #[doc = "Current number of integer ambiguity hypotheses."]
21936 pub iar_num_hypotheses: i32,
21937 #[doc = "GPS Week Number of last baseline"]
21938 pub wn: u16,
21939 #[doc = "Identification of connected RTK receiver."]
21940 pub rtk_receiver_id: u8,
21941 #[doc = "GPS-specific health report for RTK data."]
21942 pub rtk_health: u8,
21943 #[doc = "Rate of baseline messages being received by GPS"]
21944 pub rtk_rate: u8,
21945 #[doc = "Current number of sats used for RTK calculation."]
21946 pub nsats: u8,
21947 #[doc = "Coordinate system of baseline"]
21948 pub baseline_coords_type: RtkBaselineCoordinateSystem,
21949}
21950impl GPS2_RTK_DATA {
21951 pub const ENCODED_LEN: usize = 35usize;
21952 pub const DEFAULT: Self = Self {
21953 time_last_baseline_ms: 0_u32,
21954 tow: 0_u32,
21955 baseline_a_mm: 0_i32,
21956 baseline_b_mm: 0_i32,
21957 baseline_c_mm: 0_i32,
21958 accuracy: 0_u32,
21959 iar_num_hypotheses: 0_i32,
21960 wn: 0_u16,
21961 rtk_receiver_id: 0_u8,
21962 rtk_health: 0_u8,
21963 rtk_rate: 0_u8,
21964 nsats: 0_u8,
21965 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
21966 };
21967 #[cfg(feature = "arbitrary")]
21968 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21969 use arbitrary::{Arbitrary, Unstructured};
21970 let mut buf = [0u8; 1024];
21971 rng.fill_bytes(&mut buf);
21972 let mut unstructured = Unstructured::new(&buf);
21973 Self::arbitrary(&mut unstructured).unwrap_or_default()
21974 }
21975}
21976impl Default for GPS2_RTK_DATA {
21977 fn default() -> Self {
21978 Self::DEFAULT.clone()
21979 }
21980}
21981impl MessageData for GPS2_RTK_DATA {
21982 type Message = MavMessage;
21983 const ID: u32 = 128u32;
21984 const NAME: &'static str = "GPS2_RTK";
21985 const EXTRA_CRC: u8 = 226u8;
21986 const ENCODED_LEN: usize = 35usize;
21987 fn deser(
21988 _version: MavlinkVersion,
21989 __input: &[u8],
21990 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21991 let avail_len = __input.len();
21992 let mut payload_buf = [0; Self::ENCODED_LEN];
21993 let mut buf = if avail_len < Self::ENCODED_LEN {
21994 payload_buf[0..avail_len].copy_from_slice(__input);
21995 Bytes::new(&payload_buf)
21996 } else {
21997 Bytes::new(__input)
21998 };
21999 let mut __struct = Self::default();
22000 __struct.time_last_baseline_ms = buf.get_u32_le();
22001 __struct.tow = buf.get_u32_le();
22002 __struct.baseline_a_mm = buf.get_i32_le();
22003 __struct.baseline_b_mm = buf.get_i32_le();
22004 __struct.baseline_c_mm = buf.get_i32_le();
22005 __struct.accuracy = buf.get_u32_le();
22006 __struct.iar_num_hypotheses = buf.get_i32_le();
22007 __struct.wn = buf.get_u16_le();
22008 __struct.rtk_receiver_id = buf.get_u8();
22009 __struct.rtk_health = buf.get_u8();
22010 __struct.rtk_rate = buf.get_u8();
22011 __struct.nsats = buf.get_u8();
22012 let tmp = buf.get_u8();
22013 __struct.baseline_coords_type =
22014 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22015 enum_type: "RtkBaselineCoordinateSystem",
22016 value: tmp as u32,
22017 })?;
22018 Ok(__struct)
22019 }
22020 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22021 let mut __tmp = BytesMut::new(bytes);
22022 #[allow(clippy::absurd_extreme_comparisons)]
22023 #[allow(unused_comparisons)]
22024 if __tmp.remaining() < Self::ENCODED_LEN {
22025 panic!(
22026 "buffer is too small (need {} bytes, but got {})",
22027 Self::ENCODED_LEN,
22028 __tmp.remaining(),
22029 )
22030 }
22031 __tmp.put_u32_le(self.time_last_baseline_ms);
22032 __tmp.put_u32_le(self.tow);
22033 __tmp.put_i32_le(self.baseline_a_mm);
22034 __tmp.put_i32_le(self.baseline_b_mm);
22035 __tmp.put_i32_le(self.baseline_c_mm);
22036 __tmp.put_u32_le(self.accuracy);
22037 __tmp.put_i32_le(self.iar_num_hypotheses);
22038 __tmp.put_u16_le(self.wn);
22039 __tmp.put_u8(self.rtk_receiver_id);
22040 __tmp.put_u8(self.rtk_health);
22041 __tmp.put_u8(self.rtk_rate);
22042 __tmp.put_u8(self.nsats);
22043 __tmp.put_u8(self.baseline_coords_type as u8);
22044 if matches!(version, MavlinkVersion::V2) {
22045 let len = __tmp.len();
22046 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22047 } else {
22048 __tmp.len()
22049 }
22050 }
22051}
22052#[doc = "id: 395"]
22053#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
22054#[derive(Debug, Clone, PartialEq)]
22055#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22056#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22057pub struct COMPONENT_INFORMATION_DATA {
22058 #[doc = "Timestamp (time since system boot)."]
22059 pub time_boot_ms: u32,
22060 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
22061 pub general_metadata_file_crc: u32,
22062 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
22063 pub peripherals_metadata_file_crc: u32,
22064 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
22065 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22066 pub general_metadata_uri: [u8; 100],
22067 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
22068 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22069 pub peripherals_metadata_uri: [u8; 100],
22070}
22071impl COMPONENT_INFORMATION_DATA {
22072 pub const ENCODED_LEN: usize = 212usize;
22073 pub const DEFAULT: Self = Self {
22074 time_boot_ms: 0_u32,
22075 general_metadata_file_crc: 0_u32,
22076 peripherals_metadata_file_crc: 0_u32,
22077 general_metadata_uri: [0_u8; 100usize],
22078 peripherals_metadata_uri: [0_u8; 100usize],
22079 };
22080 #[cfg(feature = "arbitrary")]
22081 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22082 use arbitrary::{Arbitrary, Unstructured};
22083 let mut buf = [0u8; 1024];
22084 rng.fill_bytes(&mut buf);
22085 let mut unstructured = Unstructured::new(&buf);
22086 Self::arbitrary(&mut unstructured).unwrap_or_default()
22087 }
22088}
22089impl Default for COMPONENT_INFORMATION_DATA {
22090 fn default() -> Self {
22091 Self::DEFAULT.clone()
22092 }
22093}
22094impl MessageData for COMPONENT_INFORMATION_DATA {
22095 type Message = MavMessage;
22096 const ID: u32 = 395u32;
22097 const NAME: &'static str = "COMPONENT_INFORMATION";
22098 const EXTRA_CRC: u8 = 0u8;
22099 const ENCODED_LEN: usize = 212usize;
22100 fn deser(
22101 _version: MavlinkVersion,
22102 __input: &[u8],
22103 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22104 let avail_len = __input.len();
22105 let mut payload_buf = [0; Self::ENCODED_LEN];
22106 let mut buf = if avail_len < Self::ENCODED_LEN {
22107 payload_buf[0..avail_len].copy_from_slice(__input);
22108 Bytes::new(&payload_buf)
22109 } else {
22110 Bytes::new(__input)
22111 };
22112 let mut __struct = Self::default();
22113 __struct.time_boot_ms = buf.get_u32_le();
22114 __struct.general_metadata_file_crc = buf.get_u32_le();
22115 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
22116 for v in &mut __struct.general_metadata_uri {
22117 let val = buf.get_u8();
22118 *v = val;
22119 }
22120 for v in &mut __struct.peripherals_metadata_uri {
22121 let val = buf.get_u8();
22122 *v = val;
22123 }
22124 Ok(__struct)
22125 }
22126 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22127 let mut __tmp = BytesMut::new(bytes);
22128 #[allow(clippy::absurd_extreme_comparisons)]
22129 #[allow(unused_comparisons)]
22130 if __tmp.remaining() < Self::ENCODED_LEN {
22131 panic!(
22132 "buffer is too small (need {} bytes, but got {})",
22133 Self::ENCODED_LEN,
22134 __tmp.remaining(),
22135 )
22136 }
22137 __tmp.put_u32_le(self.time_boot_ms);
22138 __tmp.put_u32_le(self.general_metadata_file_crc);
22139 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
22140 for val in &self.general_metadata_uri {
22141 __tmp.put_u8(*val);
22142 }
22143 for val in &self.peripherals_metadata_uri {
22144 __tmp.put_u8(*val);
22145 }
22146 if matches!(version, MavlinkVersion::V2) {
22147 let len = __tmp.len();
22148 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22149 } else {
22150 __tmp.len()
22151 }
22152 }
22153}
22154#[doc = "id: 24"]
22155#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
22156#[derive(Debug, Clone, PartialEq)]
22157#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22158#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22159pub struct GPS_RAW_INT_DATA {
22160 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22161 pub time_usec: u64,
22162 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
22163 pub lat: i32,
22164 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
22165 pub lon: i32,
22166 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
22167 pub alt: i32,
22168 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
22169 pub eph: u16,
22170 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
22171 pub epv: u16,
22172 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
22173 pub vel: u16,
22174 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
22175 pub cog: u16,
22176 #[doc = "GPS fix type."]
22177 pub fix_type: GpsFixType,
22178 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
22179 pub satellites_visible: u8,
22180 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
22181 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22182 pub alt_ellipsoid: i32,
22183 #[doc = "Position uncertainty."]
22184 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22185 pub h_acc: u32,
22186 #[doc = "Altitude uncertainty."]
22187 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22188 pub v_acc: u32,
22189 #[doc = "Speed uncertainty."]
22190 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22191 pub vel_acc: u32,
22192 #[doc = "Heading / track uncertainty"]
22193 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22194 pub hdg_acc: u32,
22195 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
22196 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22197 pub yaw: u16,
22198}
22199impl GPS_RAW_INT_DATA {
22200 pub const ENCODED_LEN: usize = 52usize;
22201 pub const DEFAULT: Self = Self {
22202 time_usec: 0_u64,
22203 lat: 0_i32,
22204 lon: 0_i32,
22205 alt: 0_i32,
22206 eph: 0_u16,
22207 epv: 0_u16,
22208 vel: 0_u16,
22209 cog: 0_u16,
22210 fix_type: GpsFixType::DEFAULT,
22211 satellites_visible: 0_u8,
22212 alt_ellipsoid: 0_i32,
22213 h_acc: 0_u32,
22214 v_acc: 0_u32,
22215 vel_acc: 0_u32,
22216 hdg_acc: 0_u32,
22217 yaw: 0_u16,
22218 };
22219 #[cfg(feature = "arbitrary")]
22220 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22221 use arbitrary::{Arbitrary, Unstructured};
22222 let mut buf = [0u8; 1024];
22223 rng.fill_bytes(&mut buf);
22224 let mut unstructured = Unstructured::new(&buf);
22225 Self::arbitrary(&mut unstructured).unwrap_or_default()
22226 }
22227}
22228impl Default for GPS_RAW_INT_DATA {
22229 fn default() -> Self {
22230 Self::DEFAULT.clone()
22231 }
22232}
22233impl MessageData for GPS_RAW_INT_DATA {
22234 type Message = MavMessage;
22235 const ID: u32 = 24u32;
22236 const NAME: &'static str = "GPS_RAW_INT";
22237 const EXTRA_CRC: u8 = 24u8;
22238 const ENCODED_LEN: usize = 52usize;
22239 fn deser(
22240 _version: MavlinkVersion,
22241 __input: &[u8],
22242 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22243 let avail_len = __input.len();
22244 let mut payload_buf = [0; Self::ENCODED_LEN];
22245 let mut buf = if avail_len < Self::ENCODED_LEN {
22246 payload_buf[0..avail_len].copy_from_slice(__input);
22247 Bytes::new(&payload_buf)
22248 } else {
22249 Bytes::new(__input)
22250 };
22251 let mut __struct = Self::default();
22252 __struct.time_usec = buf.get_u64_le();
22253 __struct.lat = buf.get_i32_le();
22254 __struct.lon = buf.get_i32_le();
22255 __struct.alt = buf.get_i32_le();
22256 __struct.eph = buf.get_u16_le();
22257 __struct.epv = buf.get_u16_le();
22258 __struct.vel = buf.get_u16_le();
22259 __struct.cog = buf.get_u16_le();
22260 let tmp = buf.get_u8();
22261 __struct.fix_type =
22262 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22263 enum_type: "GpsFixType",
22264 value: tmp as u32,
22265 })?;
22266 __struct.satellites_visible = buf.get_u8();
22267 __struct.alt_ellipsoid = buf.get_i32_le();
22268 __struct.h_acc = buf.get_u32_le();
22269 __struct.v_acc = buf.get_u32_le();
22270 __struct.vel_acc = buf.get_u32_le();
22271 __struct.hdg_acc = buf.get_u32_le();
22272 __struct.yaw = buf.get_u16_le();
22273 Ok(__struct)
22274 }
22275 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22276 let mut __tmp = BytesMut::new(bytes);
22277 #[allow(clippy::absurd_extreme_comparisons)]
22278 #[allow(unused_comparisons)]
22279 if __tmp.remaining() < Self::ENCODED_LEN {
22280 panic!(
22281 "buffer is too small (need {} bytes, but got {})",
22282 Self::ENCODED_LEN,
22283 __tmp.remaining(),
22284 )
22285 }
22286 __tmp.put_u64_le(self.time_usec);
22287 __tmp.put_i32_le(self.lat);
22288 __tmp.put_i32_le(self.lon);
22289 __tmp.put_i32_le(self.alt);
22290 __tmp.put_u16_le(self.eph);
22291 __tmp.put_u16_le(self.epv);
22292 __tmp.put_u16_le(self.vel);
22293 __tmp.put_u16_le(self.cog);
22294 __tmp.put_u8(self.fix_type as u8);
22295 __tmp.put_u8(self.satellites_visible);
22296 __tmp.put_i32_le(self.alt_ellipsoid);
22297 __tmp.put_u32_le(self.h_acc);
22298 __tmp.put_u32_le(self.v_acc);
22299 __tmp.put_u32_le(self.vel_acc);
22300 __tmp.put_u32_le(self.hdg_acc);
22301 __tmp.put_u16_le(self.yaw);
22302 if matches!(version, MavlinkVersion::V2) {
22303 let len = __tmp.len();
22304 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22305 } else {
22306 __tmp.len()
22307 }
22308 }
22309}
22310#[doc = "id: 111"]
22311#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
22312#[derive(Debug, Clone, PartialEq)]
22313#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22314#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22315pub struct TIMESYNC_DATA {
22316 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
22317 pub tc1: i64,
22318 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
22319 pub ts1: i64,
22320 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
22321 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22322 pub target_system: u8,
22323 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
22324 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22325 pub target_component: u8,
22326}
22327impl TIMESYNC_DATA {
22328 pub const ENCODED_LEN: usize = 18usize;
22329 pub const DEFAULT: Self = Self {
22330 tc1: 0_i64,
22331 ts1: 0_i64,
22332 target_system: 0_u8,
22333 target_component: 0_u8,
22334 };
22335 #[cfg(feature = "arbitrary")]
22336 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22337 use arbitrary::{Arbitrary, Unstructured};
22338 let mut buf = [0u8; 1024];
22339 rng.fill_bytes(&mut buf);
22340 let mut unstructured = Unstructured::new(&buf);
22341 Self::arbitrary(&mut unstructured).unwrap_or_default()
22342 }
22343}
22344impl Default for TIMESYNC_DATA {
22345 fn default() -> Self {
22346 Self::DEFAULT.clone()
22347 }
22348}
22349impl MessageData for TIMESYNC_DATA {
22350 type Message = MavMessage;
22351 const ID: u32 = 111u32;
22352 const NAME: &'static str = "TIMESYNC";
22353 const EXTRA_CRC: u8 = 34u8;
22354 const ENCODED_LEN: usize = 18usize;
22355 fn deser(
22356 _version: MavlinkVersion,
22357 __input: &[u8],
22358 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22359 let avail_len = __input.len();
22360 let mut payload_buf = [0; Self::ENCODED_LEN];
22361 let mut buf = if avail_len < Self::ENCODED_LEN {
22362 payload_buf[0..avail_len].copy_from_slice(__input);
22363 Bytes::new(&payload_buf)
22364 } else {
22365 Bytes::new(__input)
22366 };
22367 let mut __struct = Self::default();
22368 __struct.tc1 = buf.get_i64_le();
22369 __struct.ts1 = buf.get_i64_le();
22370 __struct.target_system = buf.get_u8();
22371 __struct.target_component = buf.get_u8();
22372 Ok(__struct)
22373 }
22374 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22375 let mut __tmp = BytesMut::new(bytes);
22376 #[allow(clippy::absurd_extreme_comparisons)]
22377 #[allow(unused_comparisons)]
22378 if __tmp.remaining() < Self::ENCODED_LEN {
22379 panic!(
22380 "buffer is too small (need {} bytes, but got {})",
22381 Self::ENCODED_LEN,
22382 __tmp.remaining(),
22383 )
22384 }
22385 __tmp.put_i64_le(self.tc1);
22386 __tmp.put_i64_le(self.ts1);
22387 __tmp.put_u8(self.target_system);
22388 __tmp.put_u8(self.target_component);
22389 if matches!(version, MavlinkVersion::V2) {
22390 let len = __tmp.len();
22391 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22392 } else {
22393 __tmp.len()
22394 }
22395 }
22396}
22397#[doc = "id: 256"]
22398#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
22399#[derive(Debug, Clone, PartialEq)]
22400#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22401#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22402pub struct SETUP_SIGNING_DATA {
22403 #[doc = "initial timestamp"]
22404 pub initial_timestamp: u64,
22405 #[doc = "system id of the target"]
22406 pub target_system: u8,
22407 #[doc = "component ID of the target"]
22408 pub target_component: u8,
22409 #[doc = "signing key"]
22410 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22411 pub secret_key: [u8; 32],
22412}
22413impl SETUP_SIGNING_DATA {
22414 pub const ENCODED_LEN: usize = 42usize;
22415 pub const DEFAULT: Self = Self {
22416 initial_timestamp: 0_u64,
22417 target_system: 0_u8,
22418 target_component: 0_u8,
22419 secret_key: [0_u8; 32usize],
22420 };
22421 #[cfg(feature = "arbitrary")]
22422 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22423 use arbitrary::{Arbitrary, Unstructured};
22424 let mut buf = [0u8; 1024];
22425 rng.fill_bytes(&mut buf);
22426 let mut unstructured = Unstructured::new(&buf);
22427 Self::arbitrary(&mut unstructured).unwrap_or_default()
22428 }
22429}
22430impl Default for SETUP_SIGNING_DATA {
22431 fn default() -> Self {
22432 Self::DEFAULT.clone()
22433 }
22434}
22435impl MessageData for SETUP_SIGNING_DATA {
22436 type Message = MavMessage;
22437 const ID: u32 = 256u32;
22438 const NAME: &'static str = "SETUP_SIGNING";
22439 const EXTRA_CRC: u8 = 71u8;
22440 const ENCODED_LEN: usize = 42usize;
22441 fn deser(
22442 _version: MavlinkVersion,
22443 __input: &[u8],
22444 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22445 let avail_len = __input.len();
22446 let mut payload_buf = [0; Self::ENCODED_LEN];
22447 let mut buf = if avail_len < Self::ENCODED_LEN {
22448 payload_buf[0..avail_len].copy_from_slice(__input);
22449 Bytes::new(&payload_buf)
22450 } else {
22451 Bytes::new(__input)
22452 };
22453 let mut __struct = Self::default();
22454 __struct.initial_timestamp = buf.get_u64_le();
22455 __struct.target_system = buf.get_u8();
22456 __struct.target_component = buf.get_u8();
22457 for v in &mut __struct.secret_key {
22458 let val = buf.get_u8();
22459 *v = val;
22460 }
22461 Ok(__struct)
22462 }
22463 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22464 let mut __tmp = BytesMut::new(bytes);
22465 #[allow(clippy::absurd_extreme_comparisons)]
22466 #[allow(unused_comparisons)]
22467 if __tmp.remaining() < Self::ENCODED_LEN {
22468 panic!(
22469 "buffer is too small (need {} bytes, but got {})",
22470 Self::ENCODED_LEN,
22471 __tmp.remaining(),
22472 )
22473 }
22474 __tmp.put_u64_le(self.initial_timestamp);
22475 __tmp.put_u8(self.target_system);
22476 __tmp.put_u8(self.target_component);
22477 for val in &self.secret_key {
22478 __tmp.put_u8(*val);
22479 }
22480 if matches!(version, MavlinkVersion::V2) {
22481 let len = __tmp.len();
22482 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22483 } else {
22484 __tmp.len()
22485 }
22486 }
22487}
22488#[doc = "id: 299"]
22489#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
22490#[derive(Debug, Clone, PartialEq)]
22491#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22492#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22493pub struct WIFI_CONFIG_AP_DATA {
22494 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
22495 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22496 pub ssid: [u8; 32],
22497 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
22498 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22499 pub password: [u8; 64],
22500 #[doc = "WiFi Mode."]
22501 #[cfg_attr(feature = "serde", serde(default))]
22502 pub mode: WifiConfigApMode,
22503 #[doc = "Message acceptance response (sent back to GS)."]
22504 #[cfg_attr(feature = "serde", serde(default))]
22505 pub response: WifiConfigApResponse,
22506}
22507impl WIFI_CONFIG_AP_DATA {
22508 pub const ENCODED_LEN: usize = 98usize;
22509 pub const DEFAULT: Self = Self {
22510 ssid: [0_u8; 32usize],
22511 password: [0_u8; 64usize],
22512 mode: WifiConfigApMode::DEFAULT,
22513 response: WifiConfigApResponse::DEFAULT,
22514 };
22515 #[cfg(feature = "arbitrary")]
22516 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22517 use arbitrary::{Arbitrary, Unstructured};
22518 let mut buf = [0u8; 1024];
22519 rng.fill_bytes(&mut buf);
22520 let mut unstructured = Unstructured::new(&buf);
22521 Self::arbitrary(&mut unstructured).unwrap_or_default()
22522 }
22523}
22524impl Default for WIFI_CONFIG_AP_DATA {
22525 fn default() -> Self {
22526 Self::DEFAULT.clone()
22527 }
22528}
22529impl MessageData for WIFI_CONFIG_AP_DATA {
22530 type Message = MavMessage;
22531 const ID: u32 = 299u32;
22532 const NAME: &'static str = "WIFI_CONFIG_AP";
22533 const EXTRA_CRC: u8 = 19u8;
22534 const ENCODED_LEN: usize = 98usize;
22535 fn deser(
22536 _version: MavlinkVersion,
22537 __input: &[u8],
22538 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22539 let avail_len = __input.len();
22540 let mut payload_buf = [0; Self::ENCODED_LEN];
22541 let mut buf = if avail_len < Self::ENCODED_LEN {
22542 payload_buf[0..avail_len].copy_from_slice(__input);
22543 Bytes::new(&payload_buf)
22544 } else {
22545 Bytes::new(__input)
22546 };
22547 let mut __struct = Self::default();
22548 for v in &mut __struct.ssid {
22549 let val = buf.get_u8();
22550 *v = val;
22551 }
22552 for v in &mut __struct.password {
22553 let val = buf.get_u8();
22554 *v = val;
22555 }
22556 let tmp = buf.get_i8();
22557 __struct.mode =
22558 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22559 enum_type: "WifiConfigApMode",
22560 value: tmp as u32,
22561 })?;
22562 let tmp = buf.get_i8();
22563 __struct.response =
22564 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22565 enum_type: "WifiConfigApResponse",
22566 value: tmp as u32,
22567 })?;
22568 Ok(__struct)
22569 }
22570 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22571 let mut __tmp = BytesMut::new(bytes);
22572 #[allow(clippy::absurd_extreme_comparisons)]
22573 #[allow(unused_comparisons)]
22574 if __tmp.remaining() < Self::ENCODED_LEN {
22575 panic!(
22576 "buffer is too small (need {} bytes, but got {})",
22577 Self::ENCODED_LEN,
22578 __tmp.remaining(),
22579 )
22580 }
22581 for val in &self.ssid {
22582 __tmp.put_u8(*val);
22583 }
22584 for val in &self.password {
22585 __tmp.put_u8(*val);
22586 }
22587 __tmp.put_i8(self.mode as i8);
22588 __tmp.put_i8(self.response as i8);
22589 if matches!(version, MavlinkVersion::V2) {
22590 let len = __tmp.len();
22591 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22592 } else {
22593 __tmp.len()
22594 }
22595 }
22596}
22597#[doc = "id: 387"]
22598#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
22599#[derive(Debug, Clone, PartialEq)]
22600#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22601#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22602pub struct CANFD_FRAME_DATA {
22603 #[doc = "Frame ID"]
22604 pub id: u32,
22605 #[doc = "System ID."]
22606 pub target_system: u8,
22607 #[doc = "Component ID."]
22608 pub target_component: u8,
22609 #[doc = "bus number"]
22610 pub bus: u8,
22611 #[doc = "Frame length"]
22612 pub len: u8,
22613 #[doc = "Frame data"]
22614 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22615 pub data: [u8; 64],
22616}
22617impl CANFD_FRAME_DATA {
22618 pub const ENCODED_LEN: usize = 72usize;
22619 pub const DEFAULT: Self = Self {
22620 id: 0_u32,
22621 target_system: 0_u8,
22622 target_component: 0_u8,
22623 bus: 0_u8,
22624 len: 0_u8,
22625 data: [0_u8; 64usize],
22626 };
22627 #[cfg(feature = "arbitrary")]
22628 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22629 use arbitrary::{Arbitrary, Unstructured};
22630 let mut buf = [0u8; 1024];
22631 rng.fill_bytes(&mut buf);
22632 let mut unstructured = Unstructured::new(&buf);
22633 Self::arbitrary(&mut unstructured).unwrap_or_default()
22634 }
22635}
22636impl Default for CANFD_FRAME_DATA {
22637 fn default() -> Self {
22638 Self::DEFAULT.clone()
22639 }
22640}
22641impl MessageData for CANFD_FRAME_DATA {
22642 type Message = MavMessage;
22643 const ID: u32 = 387u32;
22644 const NAME: &'static str = "CANFD_FRAME";
22645 const EXTRA_CRC: u8 = 4u8;
22646 const ENCODED_LEN: usize = 72usize;
22647 fn deser(
22648 _version: MavlinkVersion,
22649 __input: &[u8],
22650 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22651 let avail_len = __input.len();
22652 let mut payload_buf = [0; Self::ENCODED_LEN];
22653 let mut buf = if avail_len < Self::ENCODED_LEN {
22654 payload_buf[0..avail_len].copy_from_slice(__input);
22655 Bytes::new(&payload_buf)
22656 } else {
22657 Bytes::new(__input)
22658 };
22659 let mut __struct = Self::default();
22660 __struct.id = buf.get_u32_le();
22661 __struct.target_system = buf.get_u8();
22662 __struct.target_component = buf.get_u8();
22663 __struct.bus = buf.get_u8();
22664 __struct.len = buf.get_u8();
22665 for v in &mut __struct.data {
22666 let val = buf.get_u8();
22667 *v = val;
22668 }
22669 Ok(__struct)
22670 }
22671 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22672 let mut __tmp = BytesMut::new(bytes);
22673 #[allow(clippy::absurd_extreme_comparisons)]
22674 #[allow(unused_comparisons)]
22675 if __tmp.remaining() < Self::ENCODED_LEN {
22676 panic!(
22677 "buffer is too small (need {} bytes, but got {})",
22678 Self::ENCODED_LEN,
22679 __tmp.remaining(),
22680 )
22681 }
22682 __tmp.put_u32_le(self.id);
22683 __tmp.put_u8(self.target_system);
22684 __tmp.put_u8(self.target_component);
22685 __tmp.put_u8(self.bus);
22686 __tmp.put_u8(self.len);
22687 for val in &self.data {
22688 __tmp.put_u8(*val);
22689 }
22690 if matches!(version, MavlinkVersion::V2) {
22691 let len = __tmp.len();
22692 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22693 } else {
22694 __tmp.len()
22695 }
22696 }
22697}
22698#[doc = "id: 330"]
22699#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
22700#[derive(Debug, Clone, PartialEq)]
22701#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22702#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22703pub struct OBSTACLE_DISTANCE_DATA {
22704 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22705 pub time_usec: u64,
22706 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
22707 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22708 pub distances: [u16; 72],
22709 #[doc = "Minimum distance the sensor can measure."]
22710 pub min_distance: u16,
22711 #[doc = "Maximum distance the sensor can measure."]
22712 pub max_distance: u16,
22713 #[doc = "Class id of the distance sensor type."]
22714 pub sensor_type: MavDistanceSensor,
22715 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
22716 pub increment: u8,
22717 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
22718 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22719 pub increment_f: f32,
22720 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
22721 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22722 pub angle_offset: f32,
22723 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
22724 #[cfg_attr(feature = "serde", serde(default))]
22725 pub frame: MavFrame,
22726}
22727impl OBSTACLE_DISTANCE_DATA {
22728 pub const ENCODED_LEN: usize = 167usize;
22729 pub const DEFAULT: Self = Self {
22730 time_usec: 0_u64,
22731 distances: [0_u16; 72usize],
22732 min_distance: 0_u16,
22733 max_distance: 0_u16,
22734 sensor_type: MavDistanceSensor::DEFAULT,
22735 increment: 0_u8,
22736 increment_f: 0.0_f32,
22737 angle_offset: 0.0_f32,
22738 frame: MavFrame::DEFAULT,
22739 };
22740 #[cfg(feature = "arbitrary")]
22741 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22742 use arbitrary::{Arbitrary, Unstructured};
22743 let mut buf = [0u8; 1024];
22744 rng.fill_bytes(&mut buf);
22745 let mut unstructured = Unstructured::new(&buf);
22746 Self::arbitrary(&mut unstructured).unwrap_or_default()
22747 }
22748}
22749impl Default for OBSTACLE_DISTANCE_DATA {
22750 fn default() -> Self {
22751 Self::DEFAULT.clone()
22752 }
22753}
22754impl MessageData for OBSTACLE_DISTANCE_DATA {
22755 type Message = MavMessage;
22756 const ID: u32 = 330u32;
22757 const NAME: &'static str = "OBSTACLE_DISTANCE";
22758 const EXTRA_CRC: u8 = 23u8;
22759 const ENCODED_LEN: usize = 167usize;
22760 fn deser(
22761 _version: MavlinkVersion,
22762 __input: &[u8],
22763 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22764 let avail_len = __input.len();
22765 let mut payload_buf = [0; Self::ENCODED_LEN];
22766 let mut buf = if avail_len < Self::ENCODED_LEN {
22767 payload_buf[0..avail_len].copy_from_slice(__input);
22768 Bytes::new(&payload_buf)
22769 } else {
22770 Bytes::new(__input)
22771 };
22772 let mut __struct = Self::default();
22773 __struct.time_usec = buf.get_u64_le();
22774 for v in &mut __struct.distances {
22775 let val = buf.get_u16_le();
22776 *v = val;
22777 }
22778 __struct.min_distance = buf.get_u16_le();
22779 __struct.max_distance = buf.get_u16_le();
22780 let tmp = buf.get_u8();
22781 __struct.sensor_type =
22782 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22783 enum_type: "MavDistanceSensor",
22784 value: tmp as u32,
22785 })?;
22786 __struct.increment = buf.get_u8();
22787 __struct.increment_f = buf.get_f32_le();
22788 __struct.angle_offset = buf.get_f32_le();
22789 let tmp = buf.get_u8();
22790 __struct.frame =
22791 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22792 enum_type: "MavFrame",
22793 value: tmp as u32,
22794 })?;
22795 Ok(__struct)
22796 }
22797 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22798 let mut __tmp = BytesMut::new(bytes);
22799 #[allow(clippy::absurd_extreme_comparisons)]
22800 #[allow(unused_comparisons)]
22801 if __tmp.remaining() < Self::ENCODED_LEN {
22802 panic!(
22803 "buffer is too small (need {} bytes, but got {})",
22804 Self::ENCODED_LEN,
22805 __tmp.remaining(),
22806 )
22807 }
22808 __tmp.put_u64_le(self.time_usec);
22809 for val in &self.distances {
22810 __tmp.put_u16_le(*val);
22811 }
22812 __tmp.put_u16_le(self.min_distance);
22813 __tmp.put_u16_le(self.max_distance);
22814 __tmp.put_u8(self.sensor_type as u8);
22815 __tmp.put_u8(self.increment);
22816 __tmp.put_f32_le(self.increment_f);
22817 __tmp.put_f32_le(self.angle_offset);
22818 __tmp.put_u8(self.frame as u8);
22819 if matches!(version, MavlinkVersion::V2) {
22820 let len = __tmp.len();
22821 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22822 } else {
22823 __tmp.len()
22824 }
22825 }
22826}
22827#[doc = "id: 37"]
22828#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
22829#[derive(Debug, Clone, PartialEq)]
22830#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22831#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22832pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
22833 #[doc = "Start index"]
22834 pub start_index: i16,
22835 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
22836 pub end_index: i16,
22837 #[doc = "System ID"]
22838 pub target_system: u8,
22839 #[doc = "Component ID"]
22840 pub target_component: u8,
22841 #[doc = "Mission type."]
22842 #[cfg_attr(feature = "serde", serde(default))]
22843 pub mission_type: MavMissionType,
22844}
22845impl MISSION_REQUEST_PARTIAL_LIST_DATA {
22846 pub const ENCODED_LEN: usize = 7usize;
22847 pub const DEFAULT: Self = Self {
22848 start_index: 0_i16,
22849 end_index: 0_i16,
22850 target_system: 0_u8,
22851 target_component: 0_u8,
22852 mission_type: MavMissionType::DEFAULT,
22853 };
22854 #[cfg(feature = "arbitrary")]
22855 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22856 use arbitrary::{Arbitrary, Unstructured};
22857 let mut buf = [0u8; 1024];
22858 rng.fill_bytes(&mut buf);
22859 let mut unstructured = Unstructured::new(&buf);
22860 Self::arbitrary(&mut unstructured).unwrap_or_default()
22861 }
22862}
22863impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
22864 fn default() -> Self {
22865 Self::DEFAULT.clone()
22866 }
22867}
22868impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
22869 type Message = MavMessage;
22870 const ID: u32 = 37u32;
22871 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
22872 const EXTRA_CRC: u8 = 212u8;
22873 const ENCODED_LEN: usize = 7usize;
22874 fn deser(
22875 _version: MavlinkVersion,
22876 __input: &[u8],
22877 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22878 let avail_len = __input.len();
22879 let mut payload_buf = [0; Self::ENCODED_LEN];
22880 let mut buf = if avail_len < Self::ENCODED_LEN {
22881 payload_buf[0..avail_len].copy_from_slice(__input);
22882 Bytes::new(&payload_buf)
22883 } else {
22884 Bytes::new(__input)
22885 };
22886 let mut __struct = Self::default();
22887 __struct.start_index = buf.get_i16_le();
22888 __struct.end_index = buf.get_i16_le();
22889 __struct.target_system = buf.get_u8();
22890 __struct.target_component = buf.get_u8();
22891 let tmp = buf.get_u8();
22892 __struct.mission_type =
22893 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22894 enum_type: "MavMissionType",
22895 value: tmp as u32,
22896 })?;
22897 Ok(__struct)
22898 }
22899 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22900 let mut __tmp = BytesMut::new(bytes);
22901 #[allow(clippy::absurd_extreme_comparisons)]
22902 #[allow(unused_comparisons)]
22903 if __tmp.remaining() < Self::ENCODED_LEN {
22904 panic!(
22905 "buffer is too small (need {} bytes, but got {})",
22906 Self::ENCODED_LEN,
22907 __tmp.remaining(),
22908 )
22909 }
22910 __tmp.put_i16_le(self.start_index);
22911 __tmp.put_i16_le(self.end_index);
22912 __tmp.put_u8(self.target_system);
22913 __tmp.put_u8(self.target_component);
22914 __tmp.put_u8(self.mission_type as u8);
22915 if matches!(version, MavlinkVersion::V2) {
22916 let len = __tmp.len();
22917 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22918 } else {
22919 __tmp.len()
22920 }
22921 }
22922}
22923#[doc = "id: 412"]
22924#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
22925#[derive(Debug, Clone, PartialEq)]
22926#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22927#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22928pub struct REQUEST_EVENT_DATA {
22929 #[doc = "First sequence number of the requested event."]
22930 pub first_sequence: u16,
22931 #[doc = "Last sequence number of the requested event."]
22932 pub last_sequence: u16,
22933 #[doc = "System ID"]
22934 pub target_system: u8,
22935 #[doc = "Component ID"]
22936 pub target_component: u8,
22937}
22938impl REQUEST_EVENT_DATA {
22939 pub const ENCODED_LEN: usize = 6usize;
22940 pub const DEFAULT: Self = Self {
22941 first_sequence: 0_u16,
22942 last_sequence: 0_u16,
22943 target_system: 0_u8,
22944 target_component: 0_u8,
22945 };
22946 #[cfg(feature = "arbitrary")]
22947 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22948 use arbitrary::{Arbitrary, Unstructured};
22949 let mut buf = [0u8; 1024];
22950 rng.fill_bytes(&mut buf);
22951 let mut unstructured = Unstructured::new(&buf);
22952 Self::arbitrary(&mut unstructured).unwrap_or_default()
22953 }
22954}
22955impl Default for REQUEST_EVENT_DATA {
22956 fn default() -> Self {
22957 Self::DEFAULT.clone()
22958 }
22959}
22960impl MessageData for REQUEST_EVENT_DATA {
22961 type Message = MavMessage;
22962 const ID: u32 = 412u32;
22963 const NAME: &'static str = "REQUEST_EVENT";
22964 const EXTRA_CRC: u8 = 33u8;
22965 const ENCODED_LEN: usize = 6usize;
22966 fn deser(
22967 _version: MavlinkVersion,
22968 __input: &[u8],
22969 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22970 let avail_len = __input.len();
22971 let mut payload_buf = [0; Self::ENCODED_LEN];
22972 let mut buf = if avail_len < Self::ENCODED_LEN {
22973 payload_buf[0..avail_len].copy_from_slice(__input);
22974 Bytes::new(&payload_buf)
22975 } else {
22976 Bytes::new(__input)
22977 };
22978 let mut __struct = Self::default();
22979 __struct.first_sequence = buf.get_u16_le();
22980 __struct.last_sequence = buf.get_u16_le();
22981 __struct.target_system = buf.get_u8();
22982 __struct.target_component = buf.get_u8();
22983 Ok(__struct)
22984 }
22985 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22986 let mut __tmp = BytesMut::new(bytes);
22987 #[allow(clippy::absurd_extreme_comparisons)]
22988 #[allow(unused_comparisons)]
22989 if __tmp.remaining() < Self::ENCODED_LEN {
22990 panic!(
22991 "buffer is too small (need {} bytes, but got {})",
22992 Self::ENCODED_LEN,
22993 __tmp.remaining(),
22994 )
22995 }
22996 __tmp.put_u16_le(self.first_sequence);
22997 __tmp.put_u16_le(self.last_sequence);
22998 __tmp.put_u8(self.target_system);
22999 __tmp.put_u8(self.target_component);
23000 if matches!(version, MavlinkVersion::V2) {
23001 let len = __tmp.len();
23002 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23003 } else {
23004 __tmp.len()
23005 }
23006 }
23007}
23008#[doc = "id: 47"]
23009#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
23010#[derive(Debug, Clone, PartialEq)]
23011#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23012#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23013pub struct MISSION_ACK_DATA {
23014 #[doc = "System ID"]
23015 pub target_system: u8,
23016 #[doc = "Component ID"]
23017 pub target_component: u8,
23018 #[doc = "Mission result."]
23019 pub mavtype: MavMissionResult,
23020 #[doc = "Mission type."]
23021 #[cfg_attr(feature = "serde", serde(default))]
23022 pub mission_type: MavMissionType,
23023 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
23024 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23025 pub opaque_id: u32,
23026}
23027impl MISSION_ACK_DATA {
23028 pub const ENCODED_LEN: usize = 8usize;
23029 pub const DEFAULT: Self = Self {
23030 target_system: 0_u8,
23031 target_component: 0_u8,
23032 mavtype: MavMissionResult::DEFAULT,
23033 mission_type: MavMissionType::DEFAULT,
23034 opaque_id: 0_u32,
23035 };
23036 #[cfg(feature = "arbitrary")]
23037 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23038 use arbitrary::{Arbitrary, Unstructured};
23039 let mut buf = [0u8; 1024];
23040 rng.fill_bytes(&mut buf);
23041 let mut unstructured = Unstructured::new(&buf);
23042 Self::arbitrary(&mut unstructured).unwrap_or_default()
23043 }
23044}
23045impl Default for MISSION_ACK_DATA {
23046 fn default() -> Self {
23047 Self::DEFAULT.clone()
23048 }
23049}
23050impl MessageData for MISSION_ACK_DATA {
23051 type Message = MavMessage;
23052 const ID: u32 = 47u32;
23053 const NAME: &'static str = "MISSION_ACK";
23054 const EXTRA_CRC: u8 = 153u8;
23055 const ENCODED_LEN: usize = 8usize;
23056 fn deser(
23057 _version: MavlinkVersion,
23058 __input: &[u8],
23059 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23060 let avail_len = __input.len();
23061 let mut payload_buf = [0; Self::ENCODED_LEN];
23062 let mut buf = if avail_len < Self::ENCODED_LEN {
23063 payload_buf[0..avail_len].copy_from_slice(__input);
23064 Bytes::new(&payload_buf)
23065 } else {
23066 Bytes::new(__input)
23067 };
23068 let mut __struct = Self::default();
23069 __struct.target_system = buf.get_u8();
23070 __struct.target_component = buf.get_u8();
23071 let tmp = buf.get_u8();
23072 __struct.mavtype =
23073 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23074 enum_type: "MavMissionResult",
23075 value: tmp as u32,
23076 })?;
23077 let tmp = buf.get_u8();
23078 __struct.mission_type =
23079 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23080 enum_type: "MavMissionType",
23081 value: tmp as u32,
23082 })?;
23083 __struct.opaque_id = buf.get_u32_le();
23084 Ok(__struct)
23085 }
23086 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23087 let mut __tmp = BytesMut::new(bytes);
23088 #[allow(clippy::absurd_extreme_comparisons)]
23089 #[allow(unused_comparisons)]
23090 if __tmp.remaining() < Self::ENCODED_LEN {
23091 panic!(
23092 "buffer is too small (need {} bytes, but got {})",
23093 Self::ENCODED_LEN,
23094 __tmp.remaining(),
23095 )
23096 }
23097 __tmp.put_u8(self.target_system);
23098 __tmp.put_u8(self.target_component);
23099 __tmp.put_u8(self.mavtype as u8);
23100 __tmp.put_u8(self.mission_type as u8);
23101 __tmp.put_u32_le(self.opaque_id);
23102 if matches!(version, MavlinkVersion::V2) {
23103 let len = __tmp.len();
23104 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23105 } else {
23106 __tmp.len()
23107 }
23108 }
23109}
23110#[doc = "id: 115"]
23111#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
23112#[derive(Debug, Clone, PartialEq)]
23113#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23114#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23115pub struct HIL_STATE_QUATERNION_DATA {
23116 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23117 pub time_usec: u64,
23118 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
23119 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23120 pub attitude_quaternion: [f32; 4],
23121 #[doc = "Body frame roll / phi angular speed"]
23122 pub rollspeed: f32,
23123 #[doc = "Body frame pitch / theta angular speed"]
23124 pub pitchspeed: f32,
23125 #[doc = "Body frame yaw / psi angular speed"]
23126 pub yawspeed: f32,
23127 #[doc = "Latitude"]
23128 pub lat: i32,
23129 #[doc = "Longitude"]
23130 pub lon: i32,
23131 #[doc = "Altitude"]
23132 pub alt: i32,
23133 #[doc = "Ground X Speed (Latitude)"]
23134 pub vx: i16,
23135 #[doc = "Ground Y Speed (Longitude)"]
23136 pub vy: i16,
23137 #[doc = "Ground Z Speed (Altitude)"]
23138 pub vz: i16,
23139 #[doc = "Indicated airspeed"]
23140 pub ind_airspeed: u16,
23141 #[doc = "True airspeed"]
23142 pub true_airspeed: u16,
23143 #[doc = "X acceleration"]
23144 pub xacc: i16,
23145 #[doc = "Y acceleration"]
23146 pub yacc: i16,
23147 #[doc = "Z acceleration"]
23148 pub zacc: i16,
23149}
23150impl HIL_STATE_QUATERNION_DATA {
23151 pub const ENCODED_LEN: usize = 64usize;
23152 pub const DEFAULT: Self = Self {
23153 time_usec: 0_u64,
23154 attitude_quaternion: [0.0_f32; 4usize],
23155 rollspeed: 0.0_f32,
23156 pitchspeed: 0.0_f32,
23157 yawspeed: 0.0_f32,
23158 lat: 0_i32,
23159 lon: 0_i32,
23160 alt: 0_i32,
23161 vx: 0_i16,
23162 vy: 0_i16,
23163 vz: 0_i16,
23164 ind_airspeed: 0_u16,
23165 true_airspeed: 0_u16,
23166 xacc: 0_i16,
23167 yacc: 0_i16,
23168 zacc: 0_i16,
23169 };
23170 #[cfg(feature = "arbitrary")]
23171 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23172 use arbitrary::{Arbitrary, Unstructured};
23173 let mut buf = [0u8; 1024];
23174 rng.fill_bytes(&mut buf);
23175 let mut unstructured = Unstructured::new(&buf);
23176 Self::arbitrary(&mut unstructured).unwrap_or_default()
23177 }
23178}
23179impl Default for HIL_STATE_QUATERNION_DATA {
23180 fn default() -> Self {
23181 Self::DEFAULT.clone()
23182 }
23183}
23184impl MessageData for HIL_STATE_QUATERNION_DATA {
23185 type Message = MavMessage;
23186 const ID: u32 = 115u32;
23187 const NAME: &'static str = "HIL_STATE_QUATERNION";
23188 const EXTRA_CRC: u8 = 4u8;
23189 const ENCODED_LEN: usize = 64usize;
23190 fn deser(
23191 _version: MavlinkVersion,
23192 __input: &[u8],
23193 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23194 let avail_len = __input.len();
23195 let mut payload_buf = [0; Self::ENCODED_LEN];
23196 let mut buf = if avail_len < Self::ENCODED_LEN {
23197 payload_buf[0..avail_len].copy_from_slice(__input);
23198 Bytes::new(&payload_buf)
23199 } else {
23200 Bytes::new(__input)
23201 };
23202 let mut __struct = Self::default();
23203 __struct.time_usec = buf.get_u64_le();
23204 for v in &mut __struct.attitude_quaternion {
23205 let val = buf.get_f32_le();
23206 *v = val;
23207 }
23208 __struct.rollspeed = buf.get_f32_le();
23209 __struct.pitchspeed = buf.get_f32_le();
23210 __struct.yawspeed = buf.get_f32_le();
23211 __struct.lat = buf.get_i32_le();
23212 __struct.lon = buf.get_i32_le();
23213 __struct.alt = buf.get_i32_le();
23214 __struct.vx = buf.get_i16_le();
23215 __struct.vy = buf.get_i16_le();
23216 __struct.vz = buf.get_i16_le();
23217 __struct.ind_airspeed = buf.get_u16_le();
23218 __struct.true_airspeed = buf.get_u16_le();
23219 __struct.xacc = buf.get_i16_le();
23220 __struct.yacc = buf.get_i16_le();
23221 __struct.zacc = buf.get_i16_le();
23222 Ok(__struct)
23223 }
23224 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23225 let mut __tmp = BytesMut::new(bytes);
23226 #[allow(clippy::absurd_extreme_comparisons)]
23227 #[allow(unused_comparisons)]
23228 if __tmp.remaining() < Self::ENCODED_LEN {
23229 panic!(
23230 "buffer is too small (need {} bytes, but got {})",
23231 Self::ENCODED_LEN,
23232 __tmp.remaining(),
23233 )
23234 }
23235 __tmp.put_u64_le(self.time_usec);
23236 for val in &self.attitude_quaternion {
23237 __tmp.put_f32_le(*val);
23238 }
23239 __tmp.put_f32_le(self.rollspeed);
23240 __tmp.put_f32_le(self.pitchspeed);
23241 __tmp.put_f32_le(self.yawspeed);
23242 __tmp.put_i32_le(self.lat);
23243 __tmp.put_i32_le(self.lon);
23244 __tmp.put_i32_le(self.alt);
23245 __tmp.put_i16_le(self.vx);
23246 __tmp.put_i16_le(self.vy);
23247 __tmp.put_i16_le(self.vz);
23248 __tmp.put_u16_le(self.ind_airspeed);
23249 __tmp.put_u16_le(self.true_airspeed);
23250 __tmp.put_i16_le(self.xacc);
23251 __tmp.put_i16_le(self.yacc);
23252 __tmp.put_i16_le(self.zacc);
23253 if matches!(version, MavlinkVersion::V2) {
23254 let len = __tmp.len();
23255 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23256 } else {
23257 __tmp.len()
23258 }
23259 }
23260}
23261#[doc = "id: 300"]
23262#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
23263#[derive(Debug, Clone, PartialEq)]
23264#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23265#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23266pub struct PROTOCOL_VERSION_DATA {
23267 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
23268 pub version: u16,
23269 #[doc = "Minimum MAVLink version supported"]
23270 pub min_version: u16,
23271 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
23272 pub max_version: u16,
23273 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
23274 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23275 pub spec_version_hash: [u8; 8],
23276 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
23277 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23278 pub library_version_hash: [u8; 8],
23279}
23280impl PROTOCOL_VERSION_DATA {
23281 pub const ENCODED_LEN: usize = 22usize;
23282 pub const DEFAULT: Self = Self {
23283 version: 0_u16,
23284 min_version: 0_u16,
23285 max_version: 0_u16,
23286 spec_version_hash: [0_u8; 8usize],
23287 library_version_hash: [0_u8; 8usize],
23288 };
23289 #[cfg(feature = "arbitrary")]
23290 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23291 use arbitrary::{Arbitrary, Unstructured};
23292 let mut buf = [0u8; 1024];
23293 rng.fill_bytes(&mut buf);
23294 let mut unstructured = Unstructured::new(&buf);
23295 Self::arbitrary(&mut unstructured).unwrap_or_default()
23296 }
23297}
23298impl Default for PROTOCOL_VERSION_DATA {
23299 fn default() -> Self {
23300 Self::DEFAULT.clone()
23301 }
23302}
23303impl MessageData for PROTOCOL_VERSION_DATA {
23304 type Message = MavMessage;
23305 const ID: u32 = 300u32;
23306 const NAME: &'static str = "PROTOCOL_VERSION";
23307 const EXTRA_CRC: u8 = 217u8;
23308 const ENCODED_LEN: usize = 22usize;
23309 fn deser(
23310 _version: MavlinkVersion,
23311 __input: &[u8],
23312 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23313 let avail_len = __input.len();
23314 let mut payload_buf = [0; Self::ENCODED_LEN];
23315 let mut buf = if avail_len < Self::ENCODED_LEN {
23316 payload_buf[0..avail_len].copy_from_slice(__input);
23317 Bytes::new(&payload_buf)
23318 } else {
23319 Bytes::new(__input)
23320 };
23321 let mut __struct = Self::default();
23322 __struct.version = buf.get_u16_le();
23323 __struct.min_version = buf.get_u16_le();
23324 __struct.max_version = buf.get_u16_le();
23325 for v in &mut __struct.spec_version_hash {
23326 let val = buf.get_u8();
23327 *v = val;
23328 }
23329 for v in &mut __struct.library_version_hash {
23330 let val = buf.get_u8();
23331 *v = val;
23332 }
23333 Ok(__struct)
23334 }
23335 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23336 let mut __tmp = BytesMut::new(bytes);
23337 #[allow(clippy::absurd_extreme_comparisons)]
23338 #[allow(unused_comparisons)]
23339 if __tmp.remaining() < Self::ENCODED_LEN {
23340 panic!(
23341 "buffer is too small (need {} bytes, but got {})",
23342 Self::ENCODED_LEN,
23343 __tmp.remaining(),
23344 )
23345 }
23346 __tmp.put_u16_le(self.version);
23347 __tmp.put_u16_le(self.min_version);
23348 __tmp.put_u16_le(self.max_version);
23349 for val in &self.spec_version_hash {
23350 __tmp.put_u8(*val);
23351 }
23352 for val in &self.library_version_hash {
23353 __tmp.put_u8(*val);
23354 }
23355 if matches!(version, MavlinkVersion::V2) {
23356 let len = __tmp.len();
23357 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23358 } else {
23359 __tmp.len()
23360 }
23361 }
23362}
23363#[doc = "id: 280"]
23364#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
23365#[derive(Debug, Clone, PartialEq)]
23366#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23367#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23368pub struct GIMBAL_MANAGER_INFORMATION_DATA {
23369 #[doc = "Timestamp (time since system boot)."]
23370 pub time_boot_ms: u32,
23371 #[doc = "Bitmap of gimbal capability flags."]
23372 pub cap_flags: GimbalManagerCapFlags,
23373 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
23374 pub roll_min: f32,
23375 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
23376 pub roll_max: f32,
23377 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
23378 pub pitch_min: f32,
23379 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
23380 pub pitch_max: f32,
23381 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
23382 pub yaw_min: f32,
23383 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
23384 pub yaw_max: f32,
23385 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
23386 pub gimbal_device_id: u8,
23387}
23388impl GIMBAL_MANAGER_INFORMATION_DATA {
23389 pub const ENCODED_LEN: usize = 33usize;
23390 pub const DEFAULT: Self = Self {
23391 time_boot_ms: 0_u32,
23392 cap_flags: GimbalManagerCapFlags::DEFAULT,
23393 roll_min: 0.0_f32,
23394 roll_max: 0.0_f32,
23395 pitch_min: 0.0_f32,
23396 pitch_max: 0.0_f32,
23397 yaw_min: 0.0_f32,
23398 yaw_max: 0.0_f32,
23399 gimbal_device_id: 0_u8,
23400 };
23401 #[cfg(feature = "arbitrary")]
23402 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23403 use arbitrary::{Arbitrary, Unstructured};
23404 let mut buf = [0u8; 1024];
23405 rng.fill_bytes(&mut buf);
23406 let mut unstructured = Unstructured::new(&buf);
23407 Self::arbitrary(&mut unstructured).unwrap_or_default()
23408 }
23409}
23410impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
23411 fn default() -> Self {
23412 Self::DEFAULT.clone()
23413 }
23414}
23415impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
23416 type Message = MavMessage;
23417 const ID: u32 = 280u32;
23418 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
23419 const EXTRA_CRC: u8 = 70u8;
23420 const ENCODED_LEN: usize = 33usize;
23421 fn deser(
23422 _version: MavlinkVersion,
23423 __input: &[u8],
23424 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23425 let avail_len = __input.len();
23426 let mut payload_buf = [0; Self::ENCODED_LEN];
23427 let mut buf = if avail_len < Self::ENCODED_LEN {
23428 payload_buf[0..avail_len].copy_from_slice(__input);
23429 Bytes::new(&payload_buf)
23430 } else {
23431 Bytes::new(__input)
23432 };
23433 let mut __struct = Self::default();
23434 __struct.time_boot_ms = buf.get_u32_le();
23435 let tmp = buf.get_u32_le();
23436 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
23437 tmp & GimbalManagerCapFlags::all().bits(),
23438 )
23439 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23440 flag_type: "GimbalManagerCapFlags",
23441 value: tmp as u32,
23442 })?;
23443 __struct.roll_min = buf.get_f32_le();
23444 __struct.roll_max = buf.get_f32_le();
23445 __struct.pitch_min = buf.get_f32_le();
23446 __struct.pitch_max = buf.get_f32_le();
23447 __struct.yaw_min = buf.get_f32_le();
23448 __struct.yaw_max = buf.get_f32_le();
23449 __struct.gimbal_device_id = buf.get_u8();
23450 Ok(__struct)
23451 }
23452 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23453 let mut __tmp = BytesMut::new(bytes);
23454 #[allow(clippy::absurd_extreme_comparisons)]
23455 #[allow(unused_comparisons)]
23456 if __tmp.remaining() < Self::ENCODED_LEN {
23457 panic!(
23458 "buffer is too small (need {} bytes, but got {})",
23459 Self::ENCODED_LEN,
23460 __tmp.remaining(),
23461 )
23462 }
23463 __tmp.put_u32_le(self.time_boot_ms);
23464 __tmp.put_u32_le(self.cap_flags.bits());
23465 __tmp.put_f32_le(self.roll_min);
23466 __tmp.put_f32_le(self.roll_max);
23467 __tmp.put_f32_le(self.pitch_min);
23468 __tmp.put_f32_le(self.pitch_max);
23469 __tmp.put_f32_le(self.yaw_min);
23470 __tmp.put_f32_le(self.yaw_max);
23471 __tmp.put_u8(self.gimbal_device_id);
23472 if matches!(version, MavlinkVersion::V2) {
23473 let len = __tmp.len();
23474 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23475 } else {
23476 __tmp.len()
23477 }
23478 }
23479}
23480#[doc = "id: 107"]
23481#[doc = "The IMU readings in SI units in NED body frame."]
23482#[derive(Debug, Clone, PartialEq)]
23483#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23484#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23485pub struct HIL_SENSOR_DATA {
23486 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23487 pub time_usec: u64,
23488 #[doc = "X acceleration"]
23489 pub xacc: f32,
23490 #[doc = "Y acceleration"]
23491 pub yacc: f32,
23492 #[doc = "Z acceleration"]
23493 pub zacc: f32,
23494 #[doc = "Angular speed around X axis in body frame"]
23495 pub xgyro: f32,
23496 #[doc = "Angular speed around Y axis in body frame"]
23497 pub ygyro: f32,
23498 #[doc = "Angular speed around Z axis in body frame"]
23499 pub zgyro: f32,
23500 #[doc = "X Magnetic field"]
23501 pub xmag: f32,
23502 #[doc = "Y Magnetic field"]
23503 pub ymag: f32,
23504 #[doc = "Z Magnetic field"]
23505 pub zmag: f32,
23506 #[doc = "Absolute pressure"]
23507 pub abs_pressure: f32,
23508 #[doc = "Differential pressure (airspeed)"]
23509 pub diff_pressure: f32,
23510 #[doc = "Altitude calculated from pressure"]
23511 pub pressure_alt: f32,
23512 #[doc = "Temperature"]
23513 pub temperature: f32,
23514 #[doc = "Bitmap for fields that have updated since last message"]
23515 pub fields_updated: HilSensorUpdatedFlags,
23516 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
23517 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23518 pub id: u8,
23519}
23520impl HIL_SENSOR_DATA {
23521 pub const ENCODED_LEN: usize = 65usize;
23522 pub const DEFAULT: Self = Self {
23523 time_usec: 0_u64,
23524 xacc: 0.0_f32,
23525 yacc: 0.0_f32,
23526 zacc: 0.0_f32,
23527 xgyro: 0.0_f32,
23528 ygyro: 0.0_f32,
23529 zgyro: 0.0_f32,
23530 xmag: 0.0_f32,
23531 ymag: 0.0_f32,
23532 zmag: 0.0_f32,
23533 abs_pressure: 0.0_f32,
23534 diff_pressure: 0.0_f32,
23535 pressure_alt: 0.0_f32,
23536 temperature: 0.0_f32,
23537 fields_updated: HilSensorUpdatedFlags::DEFAULT,
23538 id: 0_u8,
23539 };
23540 #[cfg(feature = "arbitrary")]
23541 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23542 use arbitrary::{Arbitrary, Unstructured};
23543 let mut buf = [0u8; 1024];
23544 rng.fill_bytes(&mut buf);
23545 let mut unstructured = Unstructured::new(&buf);
23546 Self::arbitrary(&mut unstructured).unwrap_or_default()
23547 }
23548}
23549impl Default for HIL_SENSOR_DATA {
23550 fn default() -> Self {
23551 Self::DEFAULT.clone()
23552 }
23553}
23554impl MessageData for HIL_SENSOR_DATA {
23555 type Message = MavMessage;
23556 const ID: u32 = 107u32;
23557 const NAME: &'static str = "HIL_SENSOR";
23558 const EXTRA_CRC: u8 = 108u8;
23559 const ENCODED_LEN: usize = 65usize;
23560 fn deser(
23561 _version: MavlinkVersion,
23562 __input: &[u8],
23563 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23564 let avail_len = __input.len();
23565 let mut payload_buf = [0; Self::ENCODED_LEN];
23566 let mut buf = if avail_len < Self::ENCODED_LEN {
23567 payload_buf[0..avail_len].copy_from_slice(__input);
23568 Bytes::new(&payload_buf)
23569 } else {
23570 Bytes::new(__input)
23571 };
23572 let mut __struct = Self::default();
23573 __struct.time_usec = buf.get_u64_le();
23574 __struct.xacc = buf.get_f32_le();
23575 __struct.yacc = buf.get_f32_le();
23576 __struct.zacc = buf.get_f32_le();
23577 __struct.xgyro = buf.get_f32_le();
23578 __struct.ygyro = buf.get_f32_le();
23579 __struct.zgyro = buf.get_f32_le();
23580 __struct.xmag = buf.get_f32_le();
23581 __struct.ymag = buf.get_f32_le();
23582 __struct.zmag = buf.get_f32_le();
23583 __struct.abs_pressure = buf.get_f32_le();
23584 __struct.diff_pressure = buf.get_f32_le();
23585 __struct.pressure_alt = buf.get_f32_le();
23586 __struct.temperature = buf.get_f32_le();
23587 let tmp = buf.get_u32_le();
23588 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
23589 tmp & HilSensorUpdatedFlags::all().bits(),
23590 )
23591 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23592 flag_type: "HilSensorUpdatedFlags",
23593 value: tmp as u32,
23594 })?;
23595 __struct.id = buf.get_u8();
23596 Ok(__struct)
23597 }
23598 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23599 let mut __tmp = BytesMut::new(bytes);
23600 #[allow(clippy::absurd_extreme_comparisons)]
23601 #[allow(unused_comparisons)]
23602 if __tmp.remaining() < Self::ENCODED_LEN {
23603 panic!(
23604 "buffer is too small (need {} bytes, but got {})",
23605 Self::ENCODED_LEN,
23606 __tmp.remaining(),
23607 )
23608 }
23609 __tmp.put_u64_le(self.time_usec);
23610 __tmp.put_f32_le(self.xacc);
23611 __tmp.put_f32_le(self.yacc);
23612 __tmp.put_f32_le(self.zacc);
23613 __tmp.put_f32_le(self.xgyro);
23614 __tmp.put_f32_le(self.ygyro);
23615 __tmp.put_f32_le(self.zgyro);
23616 __tmp.put_f32_le(self.xmag);
23617 __tmp.put_f32_le(self.ymag);
23618 __tmp.put_f32_le(self.zmag);
23619 __tmp.put_f32_le(self.abs_pressure);
23620 __tmp.put_f32_le(self.diff_pressure);
23621 __tmp.put_f32_le(self.pressure_alt);
23622 __tmp.put_f32_le(self.temperature);
23623 __tmp.put_u32_le(self.fields_updated.bits());
23624 __tmp.put_u8(self.id);
23625 if matches!(version, MavlinkVersion::V2) {
23626 let len = __tmp.len();
23627 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23628 } else {
23629 __tmp.len()
23630 }
23631 }
23632}
23633#[doc = "id: 110"]
23634#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
23635#[derive(Debug, Clone, PartialEq)]
23636#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23637#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23638pub struct FILE_TRANSFER_PROTOCOL_DATA {
23639 #[doc = "Network ID (0 for broadcast)"]
23640 pub target_network: u8,
23641 #[doc = "System ID (0 for broadcast)"]
23642 pub target_system: u8,
23643 #[doc = "Component ID (0 for broadcast)"]
23644 pub target_component: u8,
23645 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
23646 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23647 pub payload: [u8; 251],
23648}
23649impl FILE_TRANSFER_PROTOCOL_DATA {
23650 pub const ENCODED_LEN: usize = 254usize;
23651 pub const DEFAULT: Self = Self {
23652 target_network: 0_u8,
23653 target_system: 0_u8,
23654 target_component: 0_u8,
23655 payload: [0_u8; 251usize],
23656 };
23657 #[cfg(feature = "arbitrary")]
23658 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23659 use arbitrary::{Arbitrary, Unstructured};
23660 let mut buf = [0u8; 1024];
23661 rng.fill_bytes(&mut buf);
23662 let mut unstructured = Unstructured::new(&buf);
23663 Self::arbitrary(&mut unstructured).unwrap_or_default()
23664 }
23665}
23666impl Default for FILE_TRANSFER_PROTOCOL_DATA {
23667 fn default() -> Self {
23668 Self::DEFAULT.clone()
23669 }
23670}
23671impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
23672 type Message = MavMessage;
23673 const ID: u32 = 110u32;
23674 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
23675 const EXTRA_CRC: u8 = 84u8;
23676 const ENCODED_LEN: usize = 254usize;
23677 fn deser(
23678 _version: MavlinkVersion,
23679 __input: &[u8],
23680 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23681 let avail_len = __input.len();
23682 let mut payload_buf = [0; Self::ENCODED_LEN];
23683 let mut buf = if avail_len < Self::ENCODED_LEN {
23684 payload_buf[0..avail_len].copy_from_slice(__input);
23685 Bytes::new(&payload_buf)
23686 } else {
23687 Bytes::new(__input)
23688 };
23689 let mut __struct = Self::default();
23690 __struct.target_network = buf.get_u8();
23691 __struct.target_system = buf.get_u8();
23692 __struct.target_component = buf.get_u8();
23693 for v in &mut __struct.payload {
23694 let val = buf.get_u8();
23695 *v = val;
23696 }
23697 Ok(__struct)
23698 }
23699 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23700 let mut __tmp = BytesMut::new(bytes);
23701 #[allow(clippy::absurd_extreme_comparisons)]
23702 #[allow(unused_comparisons)]
23703 if __tmp.remaining() < Self::ENCODED_LEN {
23704 panic!(
23705 "buffer is too small (need {} bytes, but got {})",
23706 Self::ENCODED_LEN,
23707 __tmp.remaining(),
23708 )
23709 }
23710 __tmp.put_u8(self.target_network);
23711 __tmp.put_u8(self.target_system);
23712 __tmp.put_u8(self.target_component);
23713 for val in &self.payload {
23714 __tmp.put_u8(*val);
23715 }
23716 if matches!(version, MavlinkVersion::V2) {
23717 let len = __tmp.len();
23718 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23719 } else {
23720 __tmp.len()
23721 }
23722 }
23723}
23724#[doc = "id: 291"]
23725#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
23726#[derive(Debug, Clone, PartialEq)]
23727#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23728#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23729pub struct ESC_STATUS_DATA {
23730 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
23731 pub time_usec: u64,
23732 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
23733 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23734 pub rpm: [i32; 4],
23735 #[doc = "Voltage measured from each ESC."]
23736 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23737 pub voltage: [f32; 4],
23738 #[doc = "Current measured from each ESC."]
23739 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23740 pub current: [f32; 4],
23741 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
23742 pub index: u8,
23743}
23744impl ESC_STATUS_DATA {
23745 pub const ENCODED_LEN: usize = 57usize;
23746 pub const DEFAULT: Self = Self {
23747 time_usec: 0_u64,
23748 rpm: [0_i32; 4usize],
23749 voltage: [0.0_f32; 4usize],
23750 current: [0.0_f32; 4usize],
23751 index: 0_u8,
23752 };
23753 #[cfg(feature = "arbitrary")]
23754 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23755 use arbitrary::{Arbitrary, Unstructured};
23756 let mut buf = [0u8; 1024];
23757 rng.fill_bytes(&mut buf);
23758 let mut unstructured = Unstructured::new(&buf);
23759 Self::arbitrary(&mut unstructured).unwrap_or_default()
23760 }
23761}
23762impl Default for ESC_STATUS_DATA {
23763 fn default() -> Self {
23764 Self::DEFAULT.clone()
23765 }
23766}
23767impl MessageData for ESC_STATUS_DATA {
23768 type Message = MavMessage;
23769 const ID: u32 = 291u32;
23770 const NAME: &'static str = "ESC_STATUS";
23771 const EXTRA_CRC: u8 = 10u8;
23772 const ENCODED_LEN: usize = 57usize;
23773 fn deser(
23774 _version: MavlinkVersion,
23775 __input: &[u8],
23776 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23777 let avail_len = __input.len();
23778 let mut payload_buf = [0; Self::ENCODED_LEN];
23779 let mut buf = if avail_len < Self::ENCODED_LEN {
23780 payload_buf[0..avail_len].copy_from_slice(__input);
23781 Bytes::new(&payload_buf)
23782 } else {
23783 Bytes::new(__input)
23784 };
23785 let mut __struct = Self::default();
23786 __struct.time_usec = buf.get_u64_le();
23787 for v in &mut __struct.rpm {
23788 let val = buf.get_i32_le();
23789 *v = val;
23790 }
23791 for v in &mut __struct.voltage {
23792 let val = buf.get_f32_le();
23793 *v = val;
23794 }
23795 for v in &mut __struct.current {
23796 let val = buf.get_f32_le();
23797 *v = val;
23798 }
23799 __struct.index = buf.get_u8();
23800 Ok(__struct)
23801 }
23802 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23803 let mut __tmp = BytesMut::new(bytes);
23804 #[allow(clippy::absurd_extreme_comparisons)]
23805 #[allow(unused_comparisons)]
23806 if __tmp.remaining() < Self::ENCODED_LEN {
23807 panic!(
23808 "buffer is too small (need {} bytes, but got {})",
23809 Self::ENCODED_LEN,
23810 __tmp.remaining(),
23811 )
23812 }
23813 __tmp.put_u64_le(self.time_usec);
23814 for val in &self.rpm {
23815 __tmp.put_i32_le(*val);
23816 }
23817 for val in &self.voltage {
23818 __tmp.put_f32_le(*val);
23819 }
23820 for val in &self.current {
23821 __tmp.put_f32_le(*val);
23822 }
23823 __tmp.put_u8(self.index);
23824 if matches!(version, MavlinkVersion::V2) {
23825 let len = __tmp.len();
23826 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23827 } else {
23828 __tmp.len()
23829 }
23830 }
23831}
23832#[doc = "id: 283"]
23833#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
23834#[derive(Debug, Clone, PartialEq)]
23835#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23836#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23837pub struct GIMBAL_DEVICE_INFORMATION_DATA {
23838 #[doc = "UID of gimbal hardware (0 if unknown)."]
23839 pub uid: u64,
23840 #[doc = "Timestamp (time since system boot)."]
23841 pub time_boot_ms: u32,
23842 #[doc = "0xff)."]
23843 pub firmware_version: u32,
23844 #[doc = "0xff)."]
23845 pub hardware_version: u32,
23846 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
23847 pub roll_min: f32,
23848 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
23849 pub roll_max: f32,
23850 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
23851 pub pitch_min: f32,
23852 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
23853 pub pitch_max: f32,
23854 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
23855 pub yaw_min: f32,
23856 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
23857 pub yaw_max: f32,
23858 #[doc = "Bitmap of gimbal capability flags."]
23859 pub cap_flags: GimbalDeviceCapFlags,
23860 #[doc = "Bitmap for use for gimbal-specific capability flags."]
23861 pub custom_cap_flags: u16,
23862 #[doc = "Name of the gimbal vendor."]
23863 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23864 pub vendor_name: [u8; 32],
23865 #[doc = "Name of the gimbal model."]
23866 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23867 pub model_name: [u8; 32],
23868 #[doc = "Custom name of the gimbal given to it by the user."]
23869 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23870 pub custom_name: [u8; 32],
23871 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
23872 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23873 pub gimbal_device_id: u8,
23874}
23875impl GIMBAL_DEVICE_INFORMATION_DATA {
23876 pub const ENCODED_LEN: usize = 145usize;
23877 pub const DEFAULT: Self = Self {
23878 uid: 0_u64,
23879 time_boot_ms: 0_u32,
23880 firmware_version: 0_u32,
23881 hardware_version: 0_u32,
23882 roll_min: 0.0_f32,
23883 roll_max: 0.0_f32,
23884 pitch_min: 0.0_f32,
23885 pitch_max: 0.0_f32,
23886 yaw_min: 0.0_f32,
23887 yaw_max: 0.0_f32,
23888 cap_flags: GimbalDeviceCapFlags::DEFAULT,
23889 custom_cap_flags: 0_u16,
23890 vendor_name: [0_u8; 32usize],
23891 model_name: [0_u8; 32usize],
23892 custom_name: [0_u8; 32usize],
23893 gimbal_device_id: 0_u8,
23894 };
23895 #[cfg(feature = "arbitrary")]
23896 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23897 use arbitrary::{Arbitrary, Unstructured};
23898 let mut buf = [0u8; 1024];
23899 rng.fill_bytes(&mut buf);
23900 let mut unstructured = Unstructured::new(&buf);
23901 Self::arbitrary(&mut unstructured).unwrap_or_default()
23902 }
23903}
23904impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
23905 fn default() -> Self {
23906 Self::DEFAULT.clone()
23907 }
23908}
23909impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
23910 type Message = MavMessage;
23911 const ID: u32 = 283u32;
23912 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
23913 const EXTRA_CRC: u8 = 74u8;
23914 const ENCODED_LEN: usize = 145usize;
23915 fn deser(
23916 _version: MavlinkVersion,
23917 __input: &[u8],
23918 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23919 let avail_len = __input.len();
23920 let mut payload_buf = [0; Self::ENCODED_LEN];
23921 let mut buf = if avail_len < Self::ENCODED_LEN {
23922 payload_buf[0..avail_len].copy_from_slice(__input);
23923 Bytes::new(&payload_buf)
23924 } else {
23925 Bytes::new(__input)
23926 };
23927 let mut __struct = Self::default();
23928 __struct.uid = buf.get_u64_le();
23929 __struct.time_boot_ms = buf.get_u32_le();
23930 __struct.firmware_version = buf.get_u32_le();
23931 __struct.hardware_version = buf.get_u32_le();
23932 __struct.roll_min = buf.get_f32_le();
23933 __struct.roll_max = buf.get_f32_le();
23934 __struct.pitch_min = buf.get_f32_le();
23935 __struct.pitch_max = buf.get_f32_le();
23936 __struct.yaw_min = buf.get_f32_le();
23937 __struct.yaw_max = buf.get_f32_le();
23938 let tmp = buf.get_u16_le();
23939 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
23940 tmp & GimbalDeviceCapFlags::all().bits(),
23941 )
23942 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
23943 flag_type: "GimbalDeviceCapFlags",
23944 value: tmp as u32,
23945 })?;
23946 __struct.custom_cap_flags = buf.get_u16_le();
23947 for v in &mut __struct.vendor_name {
23948 let val = buf.get_u8();
23949 *v = val;
23950 }
23951 for v in &mut __struct.model_name {
23952 let val = buf.get_u8();
23953 *v = val;
23954 }
23955 for v in &mut __struct.custom_name {
23956 let val = buf.get_u8();
23957 *v = val;
23958 }
23959 __struct.gimbal_device_id = buf.get_u8();
23960 Ok(__struct)
23961 }
23962 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23963 let mut __tmp = BytesMut::new(bytes);
23964 #[allow(clippy::absurd_extreme_comparisons)]
23965 #[allow(unused_comparisons)]
23966 if __tmp.remaining() < Self::ENCODED_LEN {
23967 panic!(
23968 "buffer is too small (need {} bytes, but got {})",
23969 Self::ENCODED_LEN,
23970 __tmp.remaining(),
23971 )
23972 }
23973 __tmp.put_u64_le(self.uid);
23974 __tmp.put_u32_le(self.time_boot_ms);
23975 __tmp.put_u32_le(self.firmware_version);
23976 __tmp.put_u32_le(self.hardware_version);
23977 __tmp.put_f32_le(self.roll_min);
23978 __tmp.put_f32_le(self.roll_max);
23979 __tmp.put_f32_le(self.pitch_min);
23980 __tmp.put_f32_le(self.pitch_max);
23981 __tmp.put_f32_le(self.yaw_min);
23982 __tmp.put_f32_le(self.yaw_max);
23983 __tmp.put_u16_le(self.cap_flags.bits());
23984 __tmp.put_u16_le(self.custom_cap_flags);
23985 for val in &self.vendor_name {
23986 __tmp.put_u8(*val);
23987 }
23988 for val in &self.model_name {
23989 __tmp.put_u8(*val);
23990 }
23991 for val in &self.custom_name {
23992 __tmp.put_u8(*val);
23993 }
23994 __tmp.put_u8(self.gimbal_device_id);
23995 if matches!(version, MavlinkVersion::V2) {
23996 let len = __tmp.len();
23997 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23998 } else {
23999 __tmp.len()
24000 }
24001 }
24002}
24003#[doc = "id: 397"]
24004#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
24005#[derive(Debug, Clone, PartialEq)]
24006#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24007#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24008pub struct COMPONENT_METADATA_DATA {
24009 #[doc = "Timestamp (time since system boot)."]
24010 pub time_boot_ms: u32,
24011 #[doc = "CRC32 of the general metadata file."]
24012 pub file_crc: u32,
24013 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
24014 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24015 pub uri: [u8; 100],
24016}
24017impl COMPONENT_METADATA_DATA {
24018 pub const ENCODED_LEN: usize = 108usize;
24019 pub const DEFAULT: Self = Self {
24020 time_boot_ms: 0_u32,
24021 file_crc: 0_u32,
24022 uri: [0_u8; 100usize],
24023 };
24024 #[cfg(feature = "arbitrary")]
24025 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24026 use arbitrary::{Arbitrary, Unstructured};
24027 let mut buf = [0u8; 1024];
24028 rng.fill_bytes(&mut buf);
24029 let mut unstructured = Unstructured::new(&buf);
24030 Self::arbitrary(&mut unstructured).unwrap_or_default()
24031 }
24032}
24033impl Default for COMPONENT_METADATA_DATA {
24034 fn default() -> Self {
24035 Self::DEFAULT.clone()
24036 }
24037}
24038impl MessageData for COMPONENT_METADATA_DATA {
24039 type Message = MavMessage;
24040 const ID: u32 = 397u32;
24041 const NAME: &'static str = "COMPONENT_METADATA";
24042 const EXTRA_CRC: u8 = 182u8;
24043 const ENCODED_LEN: usize = 108usize;
24044 fn deser(
24045 _version: MavlinkVersion,
24046 __input: &[u8],
24047 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24048 let avail_len = __input.len();
24049 let mut payload_buf = [0; Self::ENCODED_LEN];
24050 let mut buf = if avail_len < Self::ENCODED_LEN {
24051 payload_buf[0..avail_len].copy_from_slice(__input);
24052 Bytes::new(&payload_buf)
24053 } else {
24054 Bytes::new(__input)
24055 };
24056 let mut __struct = Self::default();
24057 __struct.time_boot_ms = buf.get_u32_le();
24058 __struct.file_crc = buf.get_u32_le();
24059 for v in &mut __struct.uri {
24060 let val = buf.get_u8();
24061 *v = val;
24062 }
24063 Ok(__struct)
24064 }
24065 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24066 let mut __tmp = BytesMut::new(bytes);
24067 #[allow(clippy::absurd_extreme_comparisons)]
24068 #[allow(unused_comparisons)]
24069 if __tmp.remaining() < Self::ENCODED_LEN {
24070 panic!(
24071 "buffer is too small (need {} bytes, but got {})",
24072 Self::ENCODED_LEN,
24073 __tmp.remaining(),
24074 )
24075 }
24076 __tmp.put_u32_le(self.time_boot_ms);
24077 __tmp.put_u32_le(self.file_crc);
24078 for val in &self.uri {
24079 __tmp.put_u8(*val);
24080 }
24081 if matches!(version, MavlinkVersion::V2) {
24082 let len = __tmp.len();
24083 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24084 } else {
24085 __tmp.len()
24086 }
24087 }
24088}
24089#[doc = "id: 262"]
24090#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
24091#[derive(Debug, Clone, PartialEq)]
24092#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24093#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24094pub struct CAMERA_CAPTURE_STATUS_DATA {
24095 #[doc = "Timestamp (time since system boot)."]
24096 pub time_boot_ms: u32,
24097 #[doc = "Image capture interval"]
24098 pub image_interval: f32,
24099 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
24100 pub recording_time_ms: u32,
24101 #[doc = "Available storage capacity."]
24102 pub available_capacity: f32,
24103 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
24104 pub image_status: u8,
24105 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
24106 pub video_status: u8,
24107 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
24108 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24109 pub image_count: i32,
24110 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
24111 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24112 pub camera_device_id: u8,
24113}
24114impl CAMERA_CAPTURE_STATUS_DATA {
24115 pub const ENCODED_LEN: usize = 23usize;
24116 pub const DEFAULT: Self = Self {
24117 time_boot_ms: 0_u32,
24118 image_interval: 0.0_f32,
24119 recording_time_ms: 0_u32,
24120 available_capacity: 0.0_f32,
24121 image_status: 0_u8,
24122 video_status: 0_u8,
24123 image_count: 0_i32,
24124 camera_device_id: 0_u8,
24125 };
24126 #[cfg(feature = "arbitrary")]
24127 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24128 use arbitrary::{Arbitrary, Unstructured};
24129 let mut buf = [0u8; 1024];
24130 rng.fill_bytes(&mut buf);
24131 let mut unstructured = Unstructured::new(&buf);
24132 Self::arbitrary(&mut unstructured).unwrap_or_default()
24133 }
24134}
24135impl Default for CAMERA_CAPTURE_STATUS_DATA {
24136 fn default() -> Self {
24137 Self::DEFAULT.clone()
24138 }
24139}
24140impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
24141 type Message = MavMessage;
24142 const ID: u32 = 262u32;
24143 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
24144 const EXTRA_CRC: u8 = 12u8;
24145 const ENCODED_LEN: usize = 23usize;
24146 fn deser(
24147 _version: MavlinkVersion,
24148 __input: &[u8],
24149 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24150 let avail_len = __input.len();
24151 let mut payload_buf = [0; Self::ENCODED_LEN];
24152 let mut buf = if avail_len < Self::ENCODED_LEN {
24153 payload_buf[0..avail_len].copy_from_slice(__input);
24154 Bytes::new(&payload_buf)
24155 } else {
24156 Bytes::new(__input)
24157 };
24158 let mut __struct = Self::default();
24159 __struct.time_boot_ms = buf.get_u32_le();
24160 __struct.image_interval = buf.get_f32_le();
24161 __struct.recording_time_ms = buf.get_u32_le();
24162 __struct.available_capacity = buf.get_f32_le();
24163 __struct.image_status = buf.get_u8();
24164 __struct.video_status = buf.get_u8();
24165 __struct.image_count = buf.get_i32_le();
24166 __struct.camera_device_id = buf.get_u8();
24167 Ok(__struct)
24168 }
24169 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24170 let mut __tmp = BytesMut::new(bytes);
24171 #[allow(clippy::absurd_extreme_comparisons)]
24172 #[allow(unused_comparisons)]
24173 if __tmp.remaining() < Self::ENCODED_LEN {
24174 panic!(
24175 "buffer is too small (need {} bytes, but got {})",
24176 Self::ENCODED_LEN,
24177 __tmp.remaining(),
24178 )
24179 }
24180 __tmp.put_u32_le(self.time_boot_ms);
24181 __tmp.put_f32_le(self.image_interval);
24182 __tmp.put_u32_le(self.recording_time_ms);
24183 __tmp.put_f32_le(self.available_capacity);
24184 __tmp.put_u8(self.image_status);
24185 __tmp.put_u8(self.video_status);
24186 __tmp.put_i32_le(self.image_count);
24187 __tmp.put_u8(self.camera_device_id);
24188 if matches!(version, MavlinkVersion::V2) {
24189 let len = __tmp.len();
24190 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24191 } else {
24192 __tmp.len()
24193 }
24194 }
24195}
24196#[doc = "id: 243"]
24197#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
24198#[derive(Debug, Clone, PartialEq)]
24199#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24200#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24201pub struct SET_HOME_POSITION_DATA {
24202 #[doc = "Latitude (WGS84)"]
24203 pub latitude: i32,
24204 #[doc = "Longitude (WGS84)"]
24205 pub longitude: i32,
24206 #[doc = "Altitude (MSL). Positive for up."]
24207 pub altitude: i32,
24208 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
24209 pub x: f32,
24210 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
24211 pub y: f32,
24212 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
24213 pub z: f32,
24214 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
24215 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24216 pub q: [f32; 4],
24217 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
24218 pub approach_x: f32,
24219 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
24220 pub approach_y: f32,
24221 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
24222 pub approach_z: f32,
24223 #[doc = "System ID."]
24224 pub target_system: u8,
24225 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24226 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24227 pub time_usec: u64,
24228}
24229impl SET_HOME_POSITION_DATA {
24230 pub const ENCODED_LEN: usize = 61usize;
24231 pub const DEFAULT: Self = Self {
24232 latitude: 0_i32,
24233 longitude: 0_i32,
24234 altitude: 0_i32,
24235 x: 0.0_f32,
24236 y: 0.0_f32,
24237 z: 0.0_f32,
24238 q: [0.0_f32; 4usize],
24239 approach_x: 0.0_f32,
24240 approach_y: 0.0_f32,
24241 approach_z: 0.0_f32,
24242 target_system: 0_u8,
24243 time_usec: 0_u64,
24244 };
24245 #[cfg(feature = "arbitrary")]
24246 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24247 use arbitrary::{Arbitrary, Unstructured};
24248 let mut buf = [0u8; 1024];
24249 rng.fill_bytes(&mut buf);
24250 let mut unstructured = Unstructured::new(&buf);
24251 Self::arbitrary(&mut unstructured).unwrap_or_default()
24252 }
24253}
24254impl Default for SET_HOME_POSITION_DATA {
24255 fn default() -> Self {
24256 Self::DEFAULT.clone()
24257 }
24258}
24259impl MessageData for SET_HOME_POSITION_DATA {
24260 type Message = MavMessage;
24261 const ID: u32 = 243u32;
24262 const NAME: &'static str = "SET_HOME_POSITION";
24263 const EXTRA_CRC: u8 = 85u8;
24264 const ENCODED_LEN: usize = 61usize;
24265 fn deser(
24266 _version: MavlinkVersion,
24267 __input: &[u8],
24268 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24269 let avail_len = __input.len();
24270 let mut payload_buf = [0; Self::ENCODED_LEN];
24271 let mut buf = if avail_len < Self::ENCODED_LEN {
24272 payload_buf[0..avail_len].copy_from_slice(__input);
24273 Bytes::new(&payload_buf)
24274 } else {
24275 Bytes::new(__input)
24276 };
24277 let mut __struct = Self::default();
24278 __struct.latitude = buf.get_i32_le();
24279 __struct.longitude = buf.get_i32_le();
24280 __struct.altitude = buf.get_i32_le();
24281 __struct.x = buf.get_f32_le();
24282 __struct.y = buf.get_f32_le();
24283 __struct.z = buf.get_f32_le();
24284 for v in &mut __struct.q {
24285 let val = buf.get_f32_le();
24286 *v = val;
24287 }
24288 __struct.approach_x = buf.get_f32_le();
24289 __struct.approach_y = buf.get_f32_le();
24290 __struct.approach_z = buf.get_f32_le();
24291 __struct.target_system = buf.get_u8();
24292 __struct.time_usec = buf.get_u64_le();
24293 Ok(__struct)
24294 }
24295 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24296 let mut __tmp = BytesMut::new(bytes);
24297 #[allow(clippy::absurd_extreme_comparisons)]
24298 #[allow(unused_comparisons)]
24299 if __tmp.remaining() < Self::ENCODED_LEN {
24300 panic!(
24301 "buffer is too small (need {} bytes, but got {})",
24302 Self::ENCODED_LEN,
24303 __tmp.remaining(),
24304 )
24305 }
24306 __tmp.put_i32_le(self.latitude);
24307 __tmp.put_i32_le(self.longitude);
24308 __tmp.put_i32_le(self.altitude);
24309 __tmp.put_f32_le(self.x);
24310 __tmp.put_f32_le(self.y);
24311 __tmp.put_f32_le(self.z);
24312 for val in &self.q {
24313 __tmp.put_f32_le(*val);
24314 }
24315 __tmp.put_f32_le(self.approach_x);
24316 __tmp.put_f32_le(self.approach_y);
24317 __tmp.put_f32_le(self.approach_z);
24318 __tmp.put_u8(self.target_system);
24319 __tmp.put_u64_le(self.time_usec);
24320 if matches!(version, MavlinkVersion::V2) {
24321 let len = __tmp.len();
24322 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24323 } else {
24324 __tmp.len()
24325 }
24326 }
24327}
24328#[doc = "id: 118"]
24329#[doc = "Reply to LOG_REQUEST_LIST."]
24330#[derive(Debug, Clone, PartialEq)]
24331#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24332#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24333pub struct LOG_ENTRY_DATA {
24334 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
24335 pub time_utc: u32,
24336 #[doc = "Size of the log (may be approximate)"]
24337 pub size: u32,
24338 #[doc = "Log id"]
24339 pub id: u16,
24340 #[doc = "Total number of logs"]
24341 pub num_logs: u16,
24342 #[doc = "High log number"]
24343 pub last_log_num: u16,
24344}
24345impl LOG_ENTRY_DATA {
24346 pub const ENCODED_LEN: usize = 14usize;
24347 pub const DEFAULT: Self = Self {
24348 time_utc: 0_u32,
24349 size: 0_u32,
24350 id: 0_u16,
24351 num_logs: 0_u16,
24352 last_log_num: 0_u16,
24353 };
24354 #[cfg(feature = "arbitrary")]
24355 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24356 use arbitrary::{Arbitrary, Unstructured};
24357 let mut buf = [0u8; 1024];
24358 rng.fill_bytes(&mut buf);
24359 let mut unstructured = Unstructured::new(&buf);
24360 Self::arbitrary(&mut unstructured).unwrap_or_default()
24361 }
24362}
24363impl Default for LOG_ENTRY_DATA {
24364 fn default() -> Self {
24365 Self::DEFAULT.clone()
24366 }
24367}
24368impl MessageData for LOG_ENTRY_DATA {
24369 type Message = MavMessage;
24370 const ID: u32 = 118u32;
24371 const NAME: &'static str = "LOG_ENTRY";
24372 const EXTRA_CRC: u8 = 56u8;
24373 const ENCODED_LEN: usize = 14usize;
24374 fn deser(
24375 _version: MavlinkVersion,
24376 __input: &[u8],
24377 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24378 let avail_len = __input.len();
24379 let mut payload_buf = [0; Self::ENCODED_LEN];
24380 let mut buf = if avail_len < Self::ENCODED_LEN {
24381 payload_buf[0..avail_len].copy_from_slice(__input);
24382 Bytes::new(&payload_buf)
24383 } else {
24384 Bytes::new(__input)
24385 };
24386 let mut __struct = Self::default();
24387 __struct.time_utc = buf.get_u32_le();
24388 __struct.size = buf.get_u32_le();
24389 __struct.id = buf.get_u16_le();
24390 __struct.num_logs = buf.get_u16_le();
24391 __struct.last_log_num = buf.get_u16_le();
24392 Ok(__struct)
24393 }
24394 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24395 let mut __tmp = BytesMut::new(bytes);
24396 #[allow(clippy::absurd_extreme_comparisons)]
24397 #[allow(unused_comparisons)]
24398 if __tmp.remaining() < Self::ENCODED_LEN {
24399 panic!(
24400 "buffer is too small (need {} bytes, but got {})",
24401 Self::ENCODED_LEN,
24402 __tmp.remaining(),
24403 )
24404 }
24405 __tmp.put_u32_le(self.time_utc);
24406 __tmp.put_u32_le(self.size);
24407 __tmp.put_u16_le(self.id);
24408 __tmp.put_u16_le(self.num_logs);
24409 __tmp.put_u16_le(self.last_log_num);
24410 if matches!(version, MavlinkVersion::V2) {
24411 let len = __tmp.len();
24412 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24413 } else {
24414 __tmp.len()
24415 }
24416 }
24417}
24418#[doc = "id: 284"]
24419#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
24420#[derive(Debug, Clone, PartialEq)]
24421#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24422#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24423pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
24424 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
24425 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24426 pub q: [f32; 4],
24427 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
24428 pub angular_velocity_x: f32,
24429 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
24430 pub angular_velocity_y: f32,
24431 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
24432 pub angular_velocity_z: f32,
24433 #[doc = "Low level gimbal flags."]
24434 pub flags: GimbalDeviceFlags,
24435 #[doc = "System ID"]
24436 pub target_system: u8,
24437 #[doc = "Component ID"]
24438 pub target_component: u8,
24439}
24440impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
24441 pub const ENCODED_LEN: usize = 32usize;
24442 pub const DEFAULT: Self = Self {
24443 q: [0.0_f32; 4usize],
24444 angular_velocity_x: 0.0_f32,
24445 angular_velocity_y: 0.0_f32,
24446 angular_velocity_z: 0.0_f32,
24447 flags: GimbalDeviceFlags::DEFAULT,
24448 target_system: 0_u8,
24449 target_component: 0_u8,
24450 };
24451 #[cfg(feature = "arbitrary")]
24452 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24453 use arbitrary::{Arbitrary, Unstructured};
24454 let mut buf = [0u8; 1024];
24455 rng.fill_bytes(&mut buf);
24456 let mut unstructured = Unstructured::new(&buf);
24457 Self::arbitrary(&mut unstructured).unwrap_or_default()
24458 }
24459}
24460impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
24461 fn default() -> Self {
24462 Self::DEFAULT.clone()
24463 }
24464}
24465impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
24466 type Message = MavMessage;
24467 const ID: u32 = 284u32;
24468 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
24469 const EXTRA_CRC: u8 = 99u8;
24470 const ENCODED_LEN: usize = 32usize;
24471 fn deser(
24472 _version: MavlinkVersion,
24473 __input: &[u8],
24474 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24475 let avail_len = __input.len();
24476 let mut payload_buf = [0; Self::ENCODED_LEN];
24477 let mut buf = if avail_len < Self::ENCODED_LEN {
24478 payload_buf[0..avail_len].copy_from_slice(__input);
24479 Bytes::new(&payload_buf)
24480 } else {
24481 Bytes::new(__input)
24482 };
24483 let mut __struct = Self::default();
24484 for v in &mut __struct.q {
24485 let val = buf.get_f32_le();
24486 *v = val;
24487 }
24488 __struct.angular_velocity_x = buf.get_f32_le();
24489 __struct.angular_velocity_y = buf.get_f32_le();
24490 __struct.angular_velocity_z = buf.get_f32_le();
24491 let tmp = buf.get_u16_le();
24492 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
24493 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24494 flag_type: "GimbalDeviceFlags",
24495 value: tmp as u32,
24496 })?;
24497 __struct.target_system = buf.get_u8();
24498 __struct.target_component = buf.get_u8();
24499 Ok(__struct)
24500 }
24501 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24502 let mut __tmp = BytesMut::new(bytes);
24503 #[allow(clippy::absurd_extreme_comparisons)]
24504 #[allow(unused_comparisons)]
24505 if __tmp.remaining() < Self::ENCODED_LEN {
24506 panic!(
24507 "buffer is too small (need {} bytes, but got {})",
24508 Self::ENCODED_LEN,
24509 __tmp.remaining(),
24510 )
24511 }
24512 for val in &self.q {
24513 __tmp.put_f32_le(*val);
24514 }
24515 __tmp.put_f32_le(self.angular_velocity_x);
24516 __tmp.put_f32_le(self.angular_velocity_y);
24517 __tmp.put_f32_le(self.angular_velocity_z);
24518 __tmp.put_u16_le(self.flags.bits());
24519 __tmp.put_u8(self.target_system);
24520 __tmp.put_u8(self.target_component);
24521 if matches!(version, MavlinkVersion::V2) {
24522 let len = __tmp.len();
24523 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24524 } else {
24525 __tmp.len()
24526 }
24527 }
24528}
24529#[doc = "id: 127"]
24530#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
24531#[derive(Debug, Clone, PartialEq)]
24532#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24533#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24534pub struct GPS_RTK_DATA {
24535 #[doc = "Time since boot of last baseline message received."]
24536 pub time_last_baseline_ms: u32,
24537 #[doc = "GPS Time of Week of last baseline"]
24538 pub tow: u32,
24539 #[doc = "Current baseline in ECEF x or NED north component."]
24540 pub baseline_a_mm: i32,
24541 #[doc = "Current baseline in ECEF y or NED east component."]
24542 pub baseline_b_mm: i32,
24543 #[doc = "Current baseline in ECEF z or NED down component."]
24544 pub baseline_c_mm: i32,
24545 #[doc = "Current estimate of baseline accuracy."]
24546 pub accuracy: u32,
24547 #[doc = "Current number of integer ambiguity hypotheses."]
24548 pub iar_num_hypotheses: i32,
24549 #[doc = "GPS Week Number of last baseline"]
24550 pub wn: u16,
24551 #[doc = "Identification of connected RTK receiver."]
24552 pub rtk_receiver_id: u8,
24553 #[doc = "GPS-specific health report for RTK data."]
24554 pub rtk_health: u8,
24555 #[doc = "Rate of baseline messages being received by GPS"]
24556 pub rtk_rate: u8,
24557 #[doc = "Current number of sats used for RTK calculation."]
24558 pub nsats: u8,
24559 #[doc = "Coordinate system of baseline"]
24560 pub baseline_coords_type: RtkBaselineCoordinateSystem,
24561}
24562impl GPS_RTK_DATA {
24563 pub const ENCODED_LEN: usize = 35usize;
24564 pub const DEFAULT: Self = Self {
24565 time_last_baseline_ms: 0_u32,
24566 tow: 0_u32,
24567 baseline_a_mm: 0_i32,
24568 baseline_b_mm: 0_i32,
24569 baseline_c_mm: 0_i32,
24570 accuracy: 0_u32,
24571 iar_num_hypotheses: 0_i32,
24572 wn: 0_u16,
24573 rtk_receiver_id: 0_u8,
24574 rtk_health: 0_u8,
24575 rtk_rate: 0_u8,
24576 nsats: 0_u8,
24577 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
24578 };
24579 #[cfg(feature = "arbitrary")]
24580 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24581 use arbitrary::{Arbitrary, Unstructured};
24582 let mut buf = [0u8; 1024];
24583 rng.fill_bytes(&mut buf);
24584 let mut unstructured = Unstructured::new(&buf);
24585 Self::arbitrary(&mut unstructured).unwrap_or_default()
24586 }
24587}
24588impl Default for GPS_RTK_DATA {
24589 fn default() -> Self {
24590 Self::DEFAULT.clone()
24591 }
24592}
24593impl MessageData for GPS_RTK_DATA {
24594 type Message = MavMessage;
24595 const ID: u32 = 127u32;
24596 const NAME: &'static str = "GPS_RTK";
24597 const EXTRA_CRC: u8 = 25u8;
24598 const ENCODED_LEN: usize = 35usize;
24599 fn deser(
24600 _version: MavlinkVersion,
24601 __input: &[u8],
24602 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24603 let avail_len = __input.len();
24604 let mut payload_buf = [0; Self::ENCODED_LEN];
24605 let mut buf = if avail_len < Self::ENCODED_LEN {
24606 payload_buf[0..avail_len].copy_from_slice(__input);
24607 Bytes::new(&payload_buf)
24608 } else {
24609 Bytes::new(__input)
24610 };
24611 let mut __struct = Self::default();
24612 __struct.time_last_baseline_ms = buf.get_u32_le();
24613 __struct.tow = buf.get_u32_le();
24614 __struct.baseline_a_mm = buf.get_i32_le();
24615 __struct.baseline_b_mm = buf.get_i32_le();
24616 __struct.baseline_c_mm = buf.get_i32_le();
24617 __struct.accuracy = buf.get_u32_le();
24618 __struct.iar_num_hypotheses = buf.get_i32_le();
24619 __struct.wn = buf.get_u16_le();
24620 __struct.rtk_receiver_id = buf.get_u8();
24621 __struct.rtk_health = buf.get_u8();
24622 __struct.rtk_rate = buf.get_u8();
24623 __struct.nsats = buf.get_u8();
24624 let tmp = buf.get_u8();
24625 __struct.baseline_coords_type =
24626 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24627 enum_type: "RtkBaselineCoordinateSystem",
24628 value: tmp as u32,
24629 })?;
24630 Ok(__struct)
24631 }
24632 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24633 let mut __tmp = BytesMut::new(bytes);
24634 #[allow(clippy::absurd_extreme_comparisons)]
24635 #[allow(unused_comparisons)]
24636 if __tmp.remaining() < Self::ENCODED_LEN {
24637 panic!(
24638 "buffer is too small (need {} bytes, but got {})",
24639 Self::ENCODED_LEN,
24640 __tmp.remaining(),
24641 )
24642 }
24643 __tmp.put_u32_le(self.time_last_baseline_ms);
24644 __tmp.put_u32_le(self.tow);
24645 __tmp.put_i32_le(self.baseline_a_mm);
24646 __tmp.put_i32_le(self.baseline_b_mm);
24647 __tmp.put_i32_le(self.baseline_c_mm);
24648 __tmp.put_u32_le(self.accuracy);
24649 __tmp.put_i32_le(self.iar_num_hypotheses);
24650 __tmp.put_u16_le(self.wn);
24651 __tmp.put_u8(self.rtk_receiver_id);
24652 __tmp.put_u8(self.rtk_health);
24653 __tmp.put_u8(self.rtk_rate);
24654 __tmp.put_u8(self.nsats);
24655 __tmp.put_u8(self.baseline_coords_type as u8);
24656 if matches!(version, MavlinkVersion::V2) {
24657 let len = __tmp.len();
24658 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24659 } else {
24660 __tmp.len()
24661 }
24662 }
24663}
24664#[doc = "id: 269"]
24665#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
24666#[derive(Debug, Clone, PartialEq)]
24667#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24668#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24669pub struct VIDEO_STREAM_INFORMATION_DATA {
24670 #[doc = "Frame rate."]
24671 pub framerate: f32,
24672 #[doc = "Bit rate."]
24673 pub bitrate: u32,
24674 #[doc = "Bitmap of stream status flags."]
24675 pub flags: VideoStreamStatusFlags,
24676 #[doc = "Horizontal resolution."]
24677 pub resolution_h: u16,
24678 #[doc = "Vertical resolution."]
24679 pub resolution_v: u16,
24680 #[doc = "Video image rotation clockwise."]
24681 pub rotation: u16,
24682 #[doc = "Horizontal Field of view."]
24683 pub hfov: u16,
24684 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
24685 pub stream_id: u8,
24686 #[doc = "Number of streams available."]
24687 pub count: u8,
24688 #[doc = "Type of stream."]
24689 pub mavtype: VideoStreamType,
24690 #[doc = "Stream name."]
24691 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24692 pub name: [u8; 32],
24693 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
24694 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24695 pub uri: [u8; 160],
24696 #[doc = "Encoding of stream."]
24697 #[cfg_attr(feature = "serde", serde(default))]
24698 pub encoding: VideoStreamEncoding,
24699 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
24700 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24701 pub camera_device_id: u8,
24702}
24703impl VIDEO_STREAM_INFORMATION_DATA {
24704 pub const ENCODED_LEN: usize = 215usize;
24705 pub const DEFAULT: Self = Self {
24706 framerate: 0.0_f32,
24707 bitrate: 0_u32,
24708 flags: VideoStreamStatusFlags::DEFAULT,
24709 resolution_h: 0_u16,
24710 resolution_v: 0_u16,
24711 rotation: 0_u16,
24712 hfov: 0_u16,
24713 stream_id: 0_u8,
24714 count: 0_u8,
24715 mavtype: VideoStreamType::DEFAULT,
24716 name: [0_u8; 32usize],
24717 uri: [0_u8; 160usize],
24718 encoding: VideoStreamEncoding::DEFAULT,
24719 camera_device_id: 0_u8,
24720 };
24721 #[cfg(feature = "arbitrary")]
24722 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24723 use arbitrary::{Arbitrary, Unstructured};
24724 let mut buf = [0u8; 1024];
24725 rng.fill_bytes(&mut buf);
24726 let mut unstructured = Unstructured::new(&buf);
24727 Self::arbitrary(&mut unstructured).unwrap_or_default()
24728 }
24729}
24730impl Default for VIDEO_STREAM_INFORMATION_DATA {
24731 fn default() -> Self {
24732 Self::DEFAULT.clone()
24733 }
24734}
24735impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
24736 type Message = MavMessage;
24737 const ID: u32 = 269u32;
24738 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
24739 const EXTRA_CRC: u8 = 109u8;
24740 const ENCODED_LEN: usize = 215usize;
24741 fn deser(
24742 _version: MavlinkVersion,
24743 __input: &[u8],
24744 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24745 let avail_len = __input.len();
24746 let mut payload_buf = [0; Self::ENCODED_LEN];
24747 let mut buf = if avail_len < Self::ENCODED_LEN {
24748 payload_buf[0..avail_len].copy_from_slice(__input);
24749 Bytes::new(&payload_buf)
24750 } else {
24751 Bytes::new(__input)
24752 };
24753 let mut __struct = Self::default();
24754 __struct.framerate = buf.get_f32_le();
24755 __struct.bitrate = buf.get_u32_le();
24756 let tmp = buf.get_u16_le();
24757 __struct.flags = VideoStreamStatusFlags::from_bits(
24758 tmp & VideoStreamStatusFlags::all().bits(),
24759 )
24760 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24761 flag_type: "VideoStreamStatusFlags",
24762 value: tmp as u32,
24763 })?;
24764 __struct.resolution_h = buf.get_u16_le();
24765 __struct.resolution_v = buf.get_u16_le();
24766 __struct.rotation = buf.get_u16_le();
24767 __struct.hfov = buf.get_u16_le();
24768 __struct.stream_id = buf.get_u8();
24769 __struct.count = buf.get_u8();
24770 let tmp = buf.get_u8();
24771 __struct.mavtype =
24772 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24773 enum_type: "VideoStreamType",
24774 value: tmp as u32,
24775 })?;
24776 for v in &mut __struct.name {
24777 let val = buf.get_u8();
24778 *v = val;
24779 }
24780 for v in &mut __struct.uri {
24781 let val = buf.get_u8();
24782 *v = val;
24783 }
24784 let tmp = buf.get_u8();
24785 __struct.encoding =
24786 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24787 enum_type: "VideoStreamEncoding",
24788 value: tmp as u32,
24789 })?;
24790 __struct.camera_device_id = buf.get_u8();
24791 Ok(__struct)
24792 }
24793 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24794 let mut __tmp = BytesMut::new(bytes);
24795 #[allow(clippy::absurd_extreme_comparisons)]
24796 #[allow(unused_comparisons)]
24797 if __tmp.remaining() < Self::ENCODED_LEN {
24798 panic!(
24799 "buffer is too small (need {} bytes, but got {})",
24800 Self::ENCODED_LEN,
24801 __tmp.remaining(),
24802 )
24803 }
24804 __tmp.put_f32_le(self.framerate);
24805 __tmp.put_u32_le(self.bitrate);
24806 __tmp.put_u16_le(self.flags.bits());
24807 __tmp.put_u16_le(self.resolution_h);
24808 __tmp.put_u16_le(self.resolution_v);
24809 __tmp.put_u16_le(self.rotation);
24810 __tmp.put_u16_le(self.hfov);
24811 __tmp.put_u8(self.stream_id);
24812 __tmp.put_u8(self.count);
24813 __tmp.put_u8(self.mavtype as u8);
24814 for val in &self.name {
24815 __tmp.put_u8(*val);
24816 }
24817 for val in &self.uri {
24818 __tmp.put_u8(*val);
24819 }
24820 __tmp.put_u8(self.encoding as u8);
24821 __tmp.put_u8(self.camera_device_id);
24822 if matches!(version, MavlinkVersion::V2) {
24823 let len = __tmp.len();
24824 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24825 } else {
24826 __tmp.len()
24827 }
24828 }
24829}
24830#[doc = "id: 12900"]
24831#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
24832#[derive(Debug, Clone, PartialEq)]
24833#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24834#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24835pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
24836 #[doc = "System ID (0 for broadcast)."]
24837 pub target_system: u8,
24838 #[doc = "Component ID (0 for broadcast)."]
24839 pub target_component: u8,
24840 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
24841 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24842 pub id_or_mac: [u8; 20],
24843 #[doc = "Indicates the format for the uas_id field of this message."]
24844 pub id_type: MavOdidIdType,
24845 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
24846 pub ua_type: MavOdidUaType,
24847 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
24848 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24849 pub uas_id: [u8; 20],
24850}
24851impl OPEN_DRONE_ID_BASIC_ID_DATA {
24852 pub const ENCODED_LEN: usize = 44usize;
24853 pub const DEFAULT: Self = Self {
24854 target_system: 0_u8,
24855 target_component: 0_u8,
24856 id_or_mac: [0_u8; 20usize],
24857 id_type: MavOdidIdType::DEFAULT,
24858 ua_type: MavOdidUaType::DEFAULT,
24859 uas_id: [0_u8; 20usize],
24860 };
24861 #[cfg(feature = "arbitrary")]
24862 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24863 use arbitrary::{Arbitrary, Unstructured};
24864 let mut buf = [0u8; 1024];
24865 rng.fill_bytes(&mut buf);
24866 let mut unstructured = Unstructured::new(&buf);
24867 Self::arbitrary(&mut unstructured).unwrap_or_default()
24868 }
24869}
24870impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
24871 fn default() -> Self {
24872 Self::DEFAULT.clone()
24873 }
24874}
24875impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
24876 type Message = MavMessage;
24877 const ID: u32 = 12900u32;
24878 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
24879 const EXTRA_CRC: u8 = 114u8;
24880 const ENCODED_LEN: usize = 44usize;
24881 fn deser(
24882 _version: MavlinkVersion,
24883 __input: &[u8],
24884 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24885 let avail_len = __input.len();
24886 let mut payload_buf = [0; Self::ENCODED_LEN];
24887 let mut buf = if avail_len < Self::ENCODED_LEN {
24888 payload_buf[0..avail_len].copy_from_slice(__input);
24889 Bytes::new(&payload_buf)
24890 } else {
24891 Bytes::new(__input)
24892 };
24893 let mut __struct = Self::default();
24894 __struct.target_system = buf.get_u8();
24895 __struct.target_component = buf.get_u8();
24896 for v in &mut __struct.id_or_mac {
24897 let val = buf.get_u8();
24898 *v = val;
24899 }
24900 let tmp = buf.get_u8();
24901 __struct.id_type =
24902 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24903 enum_type: "MavOdidIdType",
24904 value: tmp as u32,
24905 })?;
24906 let tmp = buf.get_u8();
24907 __struct.ua_type =
24908 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24909 enum_type: "MavOdidUaType",
24910 value: tmp as u32,
24911 })?;
24912 for v in &mut __struct.uas_id {
24913 let val = buf.get_u8();
24914 *v = val;
24915 }
24916 Ok(__struct)
24917 }
24918 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24919 let mut __tmp = BytesMut::new(bytes);
24920 #[allow(clippy::absurd_extreme_comparisons)]
24921 #[allow(unused_comparisons)]
24922 if __tmp.remaining() < Self::ENCODED_LEN {
24923 panic!(
24924 "buffer is too small (need {} bytes, but got {})",
24925 Self::ENCODED_LEN,
24926 __tmp.remaining(),
24927 )
24928 }
24929 __tmp.put_u8(self.target_system);
24930 __tmp.put_u8(self.target_component);
24931 for val in &self.id_or_mac {
24932 __tmp.put_u8(*val);
24933 }
24934 __tmp.put_u8(self.id_type as u8);
24935 __tmp.put_u8(self.ua_type as u8);
24936 for val in &self.uas_id {
24937 __tmp.put_u8(*val);
24938 }
24939 if matches!(version, MavlinkVersion::V2) {
24940 let len = __tmp.len();
24941 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24942 } else {
24943 __tmp.len()
24944 }
24945 }
24946}
24947#[doc = "id: 396"]
24948#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
24949#[derive(Debug, Clone, PartialEq)]
24950#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24951#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24952pub struct COMPONENT_INFORMATION_BASIC_DATA {
24953 #[doc = "Component capability flags"]
24954 pub capabilities: MavProtocolCapability,
24955 #[doc = "Timestamp (time since system boot)."]
24956 pub time_boot_ms: u32,
24957 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
24958 pub time_manufacture_s: u32,
24959 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
24960 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24961 pub vendor_name: [u8; 32],
24962 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
24963 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24964 pub model_name: [u8; 32],
24965 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
24966 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24967 pub software_version: [u8; 24],
24968 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
24969 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24970 pub hardware_version: [u8; 24],
24971 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
24972 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24973 pub serial_number: [u8; 32],
24974}
24975impl COMPONENT_INFORMATION_BASIC_DATA {
24976 pub const ENCODED_LEN: usize = 160usize;
24977 pub const DEFAULT: Self = Self {
24978 capabilities: MavProtocolCapability::DEFAULT,
24979 time_boot_ms: 0_u32,
24980 time_manufacture_s: 0_u32,
24981 vendor_name: [0_u8; 32usize],
24982 model_name: [0_u8; 32usize],
24983 software_version: [0_u8; 24usize],
24984 hardware_version: [0_u8; 24usize],
24985 serial_number: [0_u8; 32usize],
24986 };
24987 #[cfg(feature = "arbitrary")]
24988 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24989 use arbitrary::{Arbitrary, Unstructured};
24990 let mut buf = [0u8; 1024];
24991 rng.fill_bytes(&mut buf);
24992 let mut unstructured = Unstructured::new(&buf);
24993 Self::arbitrary(&mut unstructured).unwrap_or_default()
24994 }
24995}
24996impl Default for COMPONENT_INFORMATION_BASIC_DATA {
24997 fn default() -> Self {
24998 Self::DEFAULT.clone()
24999 }
25000}
25001impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
25002 type Message = MavMessage;
25003 const ID: u32 = 396u32;
25004 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
25005 const EXTRA_CRC: u8 = 50u8;
25006 const ENCODED_LEN: usize = 160usize;
25007 fn deser(
25008 _version: MavlinkVersion,
25009 __input: &[u8],
25010 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25011 let avail_len = __input.len();
25012 let mut payload_buf = [0; Self::ENCODED_LEN];
25013 let mut buf = if avail_len < Self::ENCODED_LEN {
25014 payload_buf[0..avail_len].copy_from_slice(__input);
25015 Bytes::new(&payload_buf)
25016 } else {
25017 Bytes::new(__input)
25018 };
25019 let mut __struct = Self::default();
25020 let tmp = buf.get_u64_le();
25021 __struct.capabilities = MavProtocolCapability::from_bits(
25022 tmp & MavProtocolCapability::all().bits(),
25023 )
25024 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
25025 flag_type: "MavProtocolCapability",
25026 value: tmp as u32,
25027 })?;
25028 __struct.time_boot_ms = buf.get_u32_le();
25029 __struct.time_manufacture_s = buf.get_u32_le();
25030 for v in &mut __struct.vendor_name {
25031 let val = buf.get_u8();
25032 *v = val;
25033 }
25034 for v in &mut __struct.model_name {
25035 let val = buf.get_u8();
25036 *v = val;
25037 }
25038 for v in &mut __struct.software_version {
25039 let val = buf.get_u8();
25040 *v = val;
25041 }
25042 for v in &mut __struct.hardware_version {
25043 let val = buf.get_u8();
25044 *v = val;
25045 }
25046 for v in &mut __struct.serial_number {
25047 let val = buf.get_u8();
25048 *v = val;
25049 }
25050 Ok(__struct)
25051 }
25052 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25053 let mut __tmp = BytesMut::new(bytes);
25054 #[allow(clippy::absurd_extreme_comparisons)]
25055 #[allow(unused_comparisons)]
25056 if __tmp.remaining() < Self::ENCODED_LEN {
25057 panic!(
25058 "buffer is too small (need {} bytes, but got {})",
25059 Self::ENCODED_LEN,
25060 __tmp.remaining(),
25061 )
25062 }
25063 __tmp.put_u64_le(self.capabilities.bits());
25064 __tmp.put_u32_le(self.time_boot_ms);
25065 __tmp.put_u32_le(self.time_manufacture_s);
25066 for val in &self.vendor_name {
25067 __tmp.put_u8(*val);
25068 }
25069 for val in &self.model_name {
25070 __tmp.put_u8(*val);
25071 }
25072 for val in &self.software_version {
25073 __tmp.put_u8(*val);
25074 }
25075 for val in &self.hardware_version {
25076 __tmp.put_u8(*val);
25077 }
25078 for val in &self.serial_number {
25079 __tmp.put_u8(*val);
25080 }
25081 if matches!(version, MavlinkVersion::V2) {
25082 let len = __tmp.len();
25083 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25084 } else {
25085 __tmp.len()
25086 }
25087 }
25088}
25089#[doc = "id: 104"]
25090#[doc = "Global position estimate from a Vicon motion system source."]
25091#[derive(Debug, Clone, PartialEq)]
25092#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25093#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25094pub struct VICON_POSITION_ESTIMATE_DATA {
25095 #[doc = "Timestamp (UNIX time or time since system boot)"]
25096 pub usec: u64,
25097 #[doc = "Global X position"]
25098 pub x: f32,
25099 #[doc = "Global Y position"]
25100 pub y: f32,
25101 #[doc = "Global Z position"]
25102 pub z: f32,
25103 #[doc = "Roll angle"]
25104 pub roll: f32,
25105 #[doc = "Pitch angle"]
25106 pub pitch: f32,
25107 #[doc = "Yaw angle"]
25108 pub yaw: f32,
25109 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
25110 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25111 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25112 pub covariance: [f32; 21],
25113}
25114impl VICON_POSITION_ESTIMATE_DATA {
25115 pub const ENCODED_LEN: usize = 116usize;
25116 pub const DEFAULT: Self = Self {
25117 usec: 0_u64,
25118 x: 0.0_f32,
25119 y: 0.0_f32,
25120 z: 0.0_f32,
25121 roll: 0.0_f32,
25122 pitch: 0.0_f32,
25123 yaw: 0.0_f32,
25124 covariance: [0.0_f32; 21usize],
25125 };
25126 #[cfg(feature = "arbitrary")]
25127 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25128 use arbitrary::{Arbitrary, Unstructured};
25129 let mut buf = [0u8; 1024];
25130 rng.fill_bytes(&mut buf);
25131 let mut unstructured = Unstructured::new(&buf);
25132 Self::arbitrary(&mut unstructured).unwrap_or_default()
25133 }
25134}
25135impl Default for VICON_POSITION_ESTIMATE_DATA {
25136 fn default() -> Self {
25137 Self::DEFAULT.clone()
25138 }
25139}
25140impl MessageData for VICON_POSITION_ESTIMATE_DATA {
25141 type Message = MavMessage;
25142 const ID: u32 = 104u32;
25143 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
25144 const EXTRA_CRC: u8 = 56u8;
25145 const ENCODED_LEN: usize = 116usize;
25146 fn deser(
25147 _version: MavlinkVersion,
25148 __input: &[u8],
25149 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25150 let avail_len = __input.len();
25151 let mut payload_buf = [0; Self::ENCODED_LEN];
25152 let mut buf = if avail_len < Self::ENCODED_LEN {
25153 payload_buf[0..avail_len].copy_from_slice(__input);
25154 Bytes::new(&payload_buf)
25155 } else {
25156 Bytes::new(__input)
25157 };
25158 let mut __struct = Self::default();
25159 __struct.usec = buf.get_u64_le();
25160 __struct.x = buf.get_f32_le();
25161 __struct.y = buf.get_f32_le();
25162 __struct.z = buf.get_f32_le();
25163 __struct.roll = buf.get_f32_le();
25164 __struct.pitch = buf.get_f32_le();
25165 __struct.yaw = buf.get_f32_le();
25166 for v in &mut __struct.covariance {
25167 let val = buf.get_f32_le();
25168 *v = val;
25169 }
25170 Ok(__struct)
25171 }
25172 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25173 let mut __tmp = BytesMut::new(bytes);
25174 #[allow(clippy::absurd_extreme_comparisons)]
25175 #[allow(unused_comparisons)]
25176 if __tmp.remaining() < Self::ENCODED_LEN {
25177 panic!(
25178 "buffer is too small (need {} bytes, but got {})",
25179 Self::ENCODED_LEN,
25180 __tmp.remaining(),
25181 )
25182 }
25183 __tmp.put_u64_le(self.usec);
25184 __tmp.put_f32_le(self.x);
25185 __tmp.put_f32_le(self.y);
25186 __tmp.put_f32_le(self.z);
25187 __tmp.put_f32_le(self.roll);
25188 __tmp.put_f32_le(self.pitch);
25189 __tmp.put_f32_le(self.yaw);
25190 for val in &self.covariance {
25191 __tmp.put_f32_le(*val);
25192 }
25193 if matches!(version, MavlinkVersion::V2) {
25194 let len = __tmp.len();
25195 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25196 } else {
25197 __tmp.len()
25198 }
25199 }
25200}
25201#[doc = "id: 323"]
25202#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
25203#[derive(Debug, Clone, PartialEq)]
25204#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25206pub struct PARAM_EXT_SET_DATA {
25207 #[doc = "System ID"]
25208 pub target_system: u8,
25209 #[doc = "Component ID"]
25210 pub target_component: u8,
25211 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
25212 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25213 pub param_id: [u8; 16],
25214 #[doc = "Parameter value"]
25215 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25216 pub param_value: [u8; 128],
25217 #[doc = "Parameter type."]
25218 pub param_type: MavParamExtType,
25219}
25220impl PARAM_EXT_SET_DATA {
25221 pub const ENCODED_LEN: usize = 147usize;
25222 pub const DEFAULT: Self = Self {
25223 target_system: 0_u8,
25224 target_component: 0_u8,
25225 param_id: [0_u8; 16usize],
25226 param_value: [0_u8; 128usize],
25227 param_type: MavParamExtType::DEFAULT,
25228 };
25229 #[cfg(feature = "arbitrary")]
25230 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25231 use arbitrary::{Arbitrary, Unstructured};
25232 let mut buf = [0u8; 1024];
25233 rng.fill_bytes(&mut buf);
25234 let mut unstructured = Unstructured::new(&buf);
25235 Self::arbitrary(&mut unstructured).unwrap_or_default()
25236 }
25237}
25238impl Default for PARAM_EXT_SET_DATA {
25239 fn default() -> Self {
25240 Self::DEFAULT.clone()
25241 }
25242}
25243impl MessageData for PARAM_EXT_SET_DATA {
25244 type Message = MavMessage;
25245 const ID: u32 = 323u32;
25246 const NAME: &'static str = "PARAM_EXT_SET";
25247 const EXTRA_CRC: u8 = 78u8;
25248 const ENCODED_LEN: usize = 147usize;
25249 fn deser(
25250 _version: MavlinkVersion,
25251 __input: &[u8],
25252 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25253 let avail_len = __input.len();
25254 let mut payload_buf = [0; Self::ENCODED_LEN];
25255 let mut buf = if avail_len < Self::ENCODED_LEN {
25256 payload_buf[0..avail_len].copy_from_slice(__input);
25257 Bytes::new(&payload_buf)
25258 } else {
25259 Bytes::new(__input)
25260 };
25261 let mut __struct = Self::default();
25262 __struct.target_system = buf.get_u8();
25263 __struct.target_component = buf.get_u8();
25264 for v in &mut __struct.param_id {
25265 let val = buf.get_u8();
25266 *v = val;
25267 }
25268 for v in &mut __struct.param_value {
25269 let val = buf.get_u8();
25270 *v = val;
25271 }
25272 let tmp = buf.get_u8();
25273 __struct.param_type =
25274 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25275 enum_type: "MavParamExtType",
25276 value: tmp as u32,
25277 })?;
25278 Ok(__struct)
25279 }
25280 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25281 let mut __tmp = BytesMut::new(bytes);
25282 #[allow(clippy::absurd_extreme_comparisons)]
25283 #[allow(unused_comparisons)]
25284 if __tmp.remaining() < Self::ENCODED_LEN {
25285 panic!(
25286 "buffer is too small (need {} bytes, but got {})",
25287 Self::ENCODED_LEN,
25288 __tmp.remaining(),
25289 )
25290 }
25291 __tmp.put_u8(self.target_system);
25292 __tmp.put_u8(self.target_component);
25293 for val in &self.param_id {
25294 __tmp.put_u8(*val);
25295 }
25296 for val in &self.param_value {
25297 __tmp.put_u8(*val);
25298 }
25299 __tmp.put_u8(self.param_type as u8);
25300 if matches!(version, MavlinkVersion::V2) {
25301 let len = __tmp.len();
25302 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25303 } else {
25304 __tmp.len()
25305 }
25306 }
25307}
25308#[doc = "id: 62"]
25309#[doc = "The state of the navigation and position controller."]
25310#[derive(Debug, Clone, PartialEq)]
25311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25312#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25313pub struct NAV_CONTROLLER_OUTPUT_DATA {
25314 #[doc = "Current desired roll"]
25315 pub nav_roll: f32,
25316 #[doc = "Current desired pitch"]
25317 pub nav_pitch: f32,
25318 #[doc = "Current altitude error"]
25319 pub alt_error: f32,
25320 #[doc = "Current airspeed error"]
25321 pub aspd_error: f32,
25322 #[doc = "Current crosstrack error on x-y plane"]
25323 pub xtrack_error: f32,
25324 #[doc = "Current desired heading"]
25325 pub nav_bearing: i16,
25326 #[doc = "Bearing to current waypoint/target"]
25327 pub target_bearing: i16,
25328 #[doc = "Distance to active waypoint"]
25329 pub wp_dist: u16,
25330}
25331impl NAV_CONTROLLER_OUTPUT_DATA {
25332 pub const ENCODED_LEN: usize = 26usize;
25333 pub const DEFAULT: Self = Self {
25334 nav_roll: 0.0_f32,
25335 nav_pitch: 0.0_f32,
25336 alt_error: 0.0_f32,
25337 aspd_error: 0.0_f32,
25338 xtrack_error: 0.0_f32,
25339 nav_bearing: 0_i16,
25340 target_bearing: 0_i16,
25341 wp_dist: 0_u16,
25342 };
25343 #[cfg(feature = "arbitrary")]
25344 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25345 use arbitrary::{Arbitrary, Unstructured};
25346 let mut buf = [0u8; 1024];
25347 rng.fill_bytes(&mut buf);
25348 let mut unstructured = Unstructured::new(&buf);
25349 Self::arbitrary(&mut unstructured).unwrap_or_default()
25350 }
25351}
25352impl Default for NAV_CONTROLLER_OUTPUT_DATA {
25353 fn default() -> Self {
25354 Self::DEFAULT.clone()
25355 }
25356}
25357impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
25358 type Message = MavMessage;
25359 const ID: u32 = 62u32;
25360 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
25361 const EXTRA_CRC: u8 = 183u8;
25362 const ENCODED_LEN: usize = 26usize;
25363 fn deser(
25364 _version: MavlinkVersion,
25365 __input: &[u8],
25366 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25367 let avail_len = __input.len();
25368 let mut payload_buf = [0; Self::ENCODED_LEN];
25369 let mut buf = if avail_len < Self::ENCODED_LEN {
25370 payload_buf[0..avail_len].copy_from_slice(__input);
25371 Bytes::new(&payload_buf)
25372 } else {
25373 Bytes::new(__input)
25374 };
25375 let mut __struct = Self::default();
25376 __struct.nav_roll = buf.get_f32_le();
25377 __struct.nav_pitch = buf.get_f32_le();
25378 __struct.alt_error = buf.get_f32_le();
25379 __struct.aspd_error = buf.get_f32_le();
25380 __struct.xtrack_error = buf.get_f32_le();
25381 __struct.nav_bearing = buf.get_i16_le();
25382 __struct.target_bearing = buf.get_i16_le();
25383 __struct.wp_dist = buf.get_u16_le();
25384 Ok(__struct)
25385 }
25386 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25387 let mut __tmp = BytesMut::new(bytes);
25388 #[allow(clippy::absurd_extreme_comparisons)]
25389 #[allow(unused_comparisons)]
25390 if __tmp.remaining() < Self::ENCODED_LEN {
25391 panic!(
25392 "buffer is too small (need {} bytes, but got {})",
25393 Self::ENCODED_LEN,
25394 __tmp.remaining(),
25395 )
25396 }
25397 __tmp.put_f32_le(self.nav_roll);
25398 __tmp.put_f32_le(self.nav_pitch);
25399 __tmp.put_f32_le(self.alt_error);
25400 __tmp.put_f32_le(self.aspd_error);
25401 __tmp.put_f32_le(self.xtrack_error);
25402 __tmp.put_i16_le(self.nav_bearing);
25403 __tmp.put_i16_le(self.target_bearing);
25404 __tmp.put_u16_le(self.wp_dist);
25405 if matches!(version, MavlinkVersion::V2) {
25406 let len = __tmp.len();
25407 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25408 } else {
25409 __tmp.len()
25410 }
25411 }
25412}
25413#[doc = "id: 30"]
25414#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
25415#[derive(Debug, Clone, PartialEq)]
25416#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25417#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25418pub struct ATTITUDE_DATA {
25419 #[doc = "Timestamp (time since system boot)."]
25420 pub time_boot_ms: u32,
25421 #[doc = "Roll angle (-pi..+pi)"]
25422 pub roll: f32,
25423 #[doc = "Pitch angle (-pi..+pi)"]
25424 pub pitch: f32,
25425 #[doc = "Yaw angle (-pi..+pi)"]
25426 pub yaw: f32,
25427 #[doc = "Roll angular speed"]
25428 pub rollspeed: f32,
25429 #[doc = "Pitch angular speed"]
25430 pub pitchspeed: f32,
25431 #[doc = "Yaw angular speed"]
25432 pub yawspeed: f32,
25433}
25434impl ATTITUDE_DATA {
25435 pub const ENCODED_LEN: usize = 28usize;
25436 pub const DEFAULT: Self = Self {
25437 time_boot_ms: 0_u32,
25438 roll: 0.0_f32,
25439 pitch: 0.0_f32,
25440 yaw: 0.0_f32,
25441 rollspeed: 0.0_f32,
25442 pitchspeed: 0.0_f32,
25443 yawspeed: 0.0_f32,
25444 };
25445 #[cfg(feature = "arbitrary")]
25446 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25447 use arbitrary::{Arbitrary, Unstructured};
25448 let mut buf = [0u8; 1024];
25449 rng.fill_bytes(&mut buf);
25450 let mut unstructured = Unstructured::new(&buf);
25451 Self::arbitrary(&mut unstructured).unwrap_or_default()
25452 }
25453}
25454impl Default for ATTITUDE_DATA {
25455 fn default() -> Self {
25456 Self::DEFAULT.clone()
25457 }
25458}
25459impl MessageData for ATTITUDE_DATA {
25460 type Message = MavMessage;
25461 const ID: u32 = 30u32;
25462 const NAME: &'static str = "ATTITUDE";
25463 const EXTRA_CRC: u8 = 39u8;
25464 const ENCODED_LEN: usize = 28usize;
25465 fn deser(
25466 _version: MavlinkVersion,
25467 __input: &[u8],
25468 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25469 let avail_len = __input.len();
25470 let mut payload_buf = [0; Self::ENCODED_LEN];
25471 let mut buf = if avail_len < Self::ENCODED_LEN {
25472 payload_buf[0..avail_len].copy_from_slice(__input);
25473 Bytes::new(&payload_buf)
25474 } else {
25475 Bytes::new(__input)
25476 };
25477 let mut __struct = Self::default();
25478 __struct.time_boot_ms = buf.get_u32_le();
25479 __struct.roll = buf.get_f32_le();
25480 __struct.pitch = buf.get_f32_le();
25481 __struct.yaw = buf.get_f32_le();
25482 __struct.rollspeed = buf.get_f32_le();
25483 __struct.pitchspeed = buf.get_f32_le();
25484 __struct.yawspeed = buf.get_f32_le();
25485 Ok(__struct)
25486 }
25487 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25488 let mut __tmp = BytesMut::new(bytes);
25489 #[allow(clippy::absurd_extreme_comparisons)]
25490 #[allow(unused_comparisons)]
25491 if __tmp.remaining() < Self::ENCODED_LEN {
25492 panic!(
25493 "buffer is too small (need {} bytes, but got {})",
25494 Self::ENCODED_LEN,
25495 __tmp.remaining(),
25496 )
25497 }
25498 __tmp.put_u32_le(self.time_boot_ms);
25499 __tmp.put_f32_le(self.roll);
25500 __tmp.put_f32_le(self.pitch);
25501 __tmp.put_f32_le(self.yaw);
25502 __tmp.put_f32_le(self.rollspeed);
25503 __tmp.put_f32_le(self.pitchspeed);
25504 __tmp.put_f32_le(self.yawspeed);
25505 if matches!(version, MavlinkVersion::V2) {
25506 let len = __tmp.len();
25507 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25508 } else {
25509 __tmp.len()
25510 }
25511 }
25512}
25513#[doc = "id: 75"]
25514#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
25515#[derive(Debug, Clone, PartialEq)]
25516#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25517#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25518pub struct COMMAND_INT_DATA {
25519 #[doc = "PARAM1, see MAV_CMD enum"]
25520 pub param1: f32,
25521 #[doc = "PARAM2, see MAV_CMD enum"]
25522 pub param2: f32,
25523 #[doc = "PARAM3, see MAV_CMD enum"]
25524 pub param3: f32,
25525 #[doc = "PARAM4, see MAV_CMD enum"]
25526 pub param4: f32,
25527 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
25528 pub x: i32,
25529 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
25530 pub y: i32,
25531 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
25532 pub z: f32,
25533 #[doc = "The scheduled action for the mission item."]
25534 pub command: MavCmd,
25535 #[doc = "System ID"]
25536 pub target_system: u8,
25537 #[doc = "Component ID"]
25538 pub target_component: u8,
25539 #[doc = "The coordinate system of the COMMAND."]
25540 pub frame: MavFrame,
25541 #[doc = "Not used."]
25542 pub current: u8,
25543 #[doc = "Not used (set 0)."]
25544 pub autocontinue: u8,
25545}
25546impl COMMAND_INT_DATA {
25547 pub const ENCODED_LEN: usize = 35usize;
25548 pub const DEFAULT: Self = Self {
25549 param1: 0.0_f32,
25550 param2: 0.0_f32,
25551 param3: 0.0_f32,
25552 param4: 0.0_f32,
25553 x: 0_i32,
25554 y: 0_i32,
25555 z: 0.0_f32,
25556 command: MavCmd::DEFAULT,
25557 target_system: 0_u8,
25558 target_component: 0_u8,
25559 frame: MavFrame::DEFAULT,
25560 current: 0_u8,
25561 autocontinue: 0_u8,
25562 };
25563 #[cfg(feature = "arbitrary")]
25564 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25565 use arbitrary::{Arbitrary, Unstructured};
25566 let mut buf = [0u8; 1024];
25567 rng.fill_bytes(&mut buf);
25568 let mut unstructured = Unstructured::new(&buf);
25569 Self::arbitrary(&mut unstructured).unwrap_or_default()
25570 }
25571}
25572impl Default for COMMAND_INT_DATA {
25573 fn default() -> Self {
25574 Self::DEFAULT.clone()
25575 }
25576}
25577impl MessageData for COMMAND_INT_DATA {
25578 type Message = MavMessage;
25579 const ID: u32 = 75u32;
25580 const NAME: &'static str = "COMMAND_INT";
25581 const EXTRA_CRC: u8 = 158u8;
25582 const ENCODED_LEN: usize = 35usize;
25583 fn deser(
25584 _version: MavlinkVersion,
25585 __input: &[u8],
25586 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25587 let avail_len = __input.len();
25588 let mut payload_buf = [0; Self::ENCODED_LEN];
25589 let mut buf = if avail_len < Self::ENCODED_LEN {
25590 payload_buf[0..avail_len].copy_from_slice(__input);
25591 Bytes::new(&payload_buf)
25592 } else {
25593 Bytes::new(__input)
25594 };
25595 let mut __struct = Self::default();
25596 __struct.param1 = buf.get_f32_le();
25597 __struct.param2 = buf.get_f32_le();
25598 __struct.param3 = buf.get_f32_le();
25599 __struct.param4 = buf.get_f32_le();
25600 __struct.x = buf.get_i32_le();
25601 __struct.y = buf.get_i32_le();
25602 __struct.z = buf.get_f32_le();
25603 let tmp = buf.get_u16_le();
25604 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
25605 ::mavlink_core::error::ParserError::InvalidEnum {
25606 enum_type: "MavCmd",
25607 value: tmp as u32,
25608 },
25609 )?;
25610 __struct.target_system = buf.get_u8();
25611 __struct.target_component = buf.get_u8();
25612 let tmp = buf.get_u8();
25613 __struct.frame =
25614 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25615 enum_type: "MavFrame",
25616 value: tmp as u32,
25617 })?;
25618 __struct.current = buf.get_u8();
25619 __struct.autocontinue = buf.get_u8();
25620 Ok(__struct)
25621 }
25622 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25623 let mut __tmp = BytesMut::new(bytes);
25624 #[allow(clippy::absurd_extreme_comparisons)]
25625 #[allow(unused_comparisons)]
25626 if __tmp.remaining() < Self::ENCODED_LEN {
25627 panic!(
25628 "buffer is too small (need {} bytes, but got {})",
25629 Self::ENCODED_LEN,
25630 __tmp.remaining(),
25631 )
25632 }
25633 __tmp.put_f32_le(self.param1);
25634 __tmp.put_f32_le(self.param2);
25635 __tmp.put_f32_le(self.param3);
25636 __tmp.put_f32_le(self.param4);
25637 __tmp.put_i32_le(self.x);
25638 __tmp.put_i32_le(self.y);
25639 __tmp.put_f32_le(self.z);
25640 __tmp.put_u16_le(self.command as u16);
25641 __tmp.put_u8(self.target_system);
25642 __tmp.put_u8(self.target_component);
25643 __tmp.put_u8(self.frame as u8);
25644 __tmp.put_u8(self.current);
25645 __tmp.put_u8(self.autocontinue);
25646 if matches!(version, MavlinkVersion::V2) {
25647 let len = __tmp.len();
25648 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25649 } else {
25650 __tmp.len()
25651 }
25652 }
25653}
25654#[doc = "id: 267"]
25655#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
25656#[derive(Debug, Clone, PartialEq)]
25657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25658#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25659pub struct LOGGING_DATA_ACKED_DATA {
25660 #[doc = "sequence number (can wrap)"]
25661 pub sequence: u16,
25662 #[doc = "system ID of the target"]
25663 pub target_system: u8,
25664 #[doc = "component ID of the target"]
25665 pub target_component: u8,
25666 #[doc = "data length"]
25667 pub length: u8,
25668 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
25669 pub first_message_offset: u8,
25670 #[doc = "logged data"]
25671 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25672 pub data: [u8; 249],
25673}
25674impl LOGGING_DATA_ACKED_DATA {
25675 pub const ENCODED_LEN: usize = 255usize;
25676 pub const DEFAULT: Self = Self {
25677 sequence: 0_u16,
25678 target_system: 0_u8,
25679 target_component: 0_u8,
25680 length: 0_u8,
25681 first_message_offset: 0_u8,
25682 data: [0_u8; 249usize],
25683 };
25684 #[cfg(feature = "arbitrary")]
25685 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25686 use arbitrary::{Arbitrary, Unstructured};
25687 let mut buf = [0u8; 1024];
25688 rng.fill_bytes(&mut buf);
25689 let mut unstructured = Unstructured::new(&buf);
25690 Self::arbitrary(&mut unstructured).unwrap_or_default()
25691 }
25692}
25693impl Default for LOGGING_DATA_ACKED_DATA {
25694 fn default() -> Self {
25695 Self::DEFAULT.clone()
25696 }
25697}
25698impl MessageData for LOGGING_DATA_ACKED_DATA {
25699 type Message = MavMessage;
25700 const ID: u32 = 267u32;
25701 const NAME: &'static str = "LOGGING_DATA_ACKED";
25702 const EXTRA_CRC: u8 = 35u8;
25703 const ENCODED_LEN: usize = 255usize;
25704 fn deser(
25705 _version: MavlinkVersion,
25706 __input: &[u8],
25707 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25708 let avail_len = __input.len();
25709 let mut payload_buf = [0; Self::ENCODED_LEN];
25710 let mut buf = if avail_len < Self::ENCODED_LEN {
25711 payload_buf[0..avail_len].copy_from_slice(__input);
25712 Bytes::new(&payload_buf)
25713 } else {
25714 Bytes::new(__input)
25715 };
25716 let mut __struct = Self::default();
25717 __struct.sequence = buf.get_u16_le();
25718 __struct.target_system = buf.get_u8();
25719 __struct.target_component = buf.get_u8();
25720 __struct.length = buf.get_u8();
25721 __struct.first_message_offset = buf.get_u8();
25722 for v in &mut __struct.data {
25723 let val = buf.get_u8();
25724 *v = val;
25725 }
25726 Ok(__struct)
25727 }
25728 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25729 let mut __tmp = BytesMut::new(bytes);
25730 #[allow(clippy::absurd_extreme_comparisons)]
25731 #[allow(unused_comparisons)]
25732 if __tmp.remaining() < Self::ENCODED_LEN {
25733 panic!(
25734 "buffer is too small (need {} bytes, but got {})",
25735 Self::ENCODED_LEN,
25736 __tmp.remaining(),
25737 )
25738 }
25739 __tmp.put_u16_le(self.sequence);
25740 __tmp.put_u8(self.target_system);
25741 __tmp.put_u8(self.target_component);
25742 __tmp.put_u8(self.length);
25743 __tmp.put_u8(self.first_message_offset);
25744 for val in &self.data {
25745 __tmp.put_u8(*val);
25746 }
25747 if matches!(version, MavlinkVersion::V2) {
25748 let len = __tmp.len();
25749 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25750 } else {
25751 __tmp.len()
25752 }
25753 }
25754}
25755#[doc = "id: 82"]
25756#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
25757#[derive(Debug, Clone, PartialEq)]
25758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25759#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25760pub struct SET_ATTITUDE_TARGET_DATA {
25761 #[doc = "Timestamp (time since system boot)."]
25762 pub time_boot_ms: u32,
25763 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
25764 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25765 pub q: [f32; 4],
25766 #[doc = "Body roll rate"]
25767 pub body_roll_rate: f32,
25768 #[doc = "Body pitch rate"]
25769 pub body_pitch_rate: f32,
25770 #[doc = "Body yaw rate"]
25771 pub body_yaw_rate: f32,
25772 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
25773 pub thrust: f32,
25774 #[doc = "System ID"]
25775 pub target_system: u8,
25776 #[doc = "Component ID"]
25777 pub target_component: u8,
25778 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
25779 pub type_mask: AttitudeTargetTypemask,
25780 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
25781 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25782 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25783 pub thrust_body: [f32; 3],
25784}
25785impl SET_ATTITUDE_TARGET_DATA {
25786 pub const ENCODED_LEN: usize = 51usize;
25787 pub const DEFAULT: Self = Self {
25788 time_boot_ms: 0_u32,
25789 q: [0.0_f32; 4usize],
25790 body_roll_rate: 0.0_f32,
25791 body_pitch_rate: 0.0_f32,
25792 body_yaw_rate: 0.0_f32,
25793 thrust: 0.0_f32,
25794 target_system: 0_u8,
25795 target_component: 0_u8,
25796 type_mask: AttitudeTargetTypemask::DEFAULT,
25797 thrust_body: [0.0_f32; 3usize],
25798 };
25799 #[cfg(feature = "arbitrary")]
25800 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25801 use arbitrary::{Arbitrary, Unstructured};
25802 let mut buf = [0u8; 1024];
25803 rng.fill_bytes(&mut buf);
25804 let mut unstructured = Unstructured::new(&buf);
25805 Self::arbitrary(&mut unstructured).unwrap_or_default()
25806 }
25807}
25808impl Default for SET_ATTITUDE_TARGET_DATA {
25809 fn default() -> Self {
25810 Self::DEFAULT.clone()
25811 }
25812}
25813impl MessageData for SET_ATTITUDE_TARGET_DATA {
25814 type Message = MavMessage;
25815 const ID: u32 = 82u32;
25816 const NAME: &'static str = "SET_ATTITUDE_TARGET";
25817 const EXTRA_CRC: u8 = 49u8;
25818 const ENCODED_LEN: usize = 51usize;
25819 fn deser(
25820 _version: MavlinkVersion,
25821 __input: &[u8],
25822 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25823 let avail_len = __input.len();
25824 let mut payload_buf = [0; Self::ENCODED_LEN];
25825 let mut buf = if avail_len < Self::ENCODED_LEN {
25826 payload_buf[0..avail_len].copy_from_slice(__input);
25827 Bytes::new(&payload_buf)
25828 } else {
25829 Bytes::new(__input)
25830 };
25831 let mut __struct = Self::default();
25832 __struct.time_boot_ms = buf.get_u32_le();
25833 for v in &mut __struct.q {
25834 let val = buf.get_f32_le();
25835 *v = val;
25836 }
25837 __struct.body_roll_rate = buf.get_f32_le();
25838 __struct.body_pitch_rate = buf.get_f32_le();
25839 __struct.body_yaw_rate = buf.get_f32_le();
25840 __struct.thrust = buf.get_f32_le();
25841 __struct.target_system = buf.get_u8();
25842 __struct.target_component = buf.get_u8();
25843 let tmp = buf.get_u8();
25844 __struct.type_mask = AttitudeTargetTypemask::from_bits(
25845 tmp & AttitudeTargetTypemask::all().bits(),
25846 )
25847 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
25848 flag_type: "AttitudeTargetTypemask",
25849 value: tmp as u32,
25850 })?;
25851 for v in &mut __struct.thrust_body {
25852 let val = buf.get_f32_le();
25853 *v = val;
25854 }
25855 Ok(__struct)
25856 }
25857 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25858 let mut __tmp = BytesMut::new(bytes);
25859 #[allow(clippy::absurd_extreme_comparisons)]
25860 #[allow(unused_comparisons)]
25861 if __tmp.remaining() < Self::ENCODED_LEN {
25862 panic!(
25863 "buffer is too small (need {} bytes, but got {})",
25864 Self::ENCODED_LEN,
25865 __tmp.remaining(),
25866 )
25867 }
25868 __tmp.put_u32_le(self.time_boot_ms);
25869 for val in &self.q {
25870 __tmp.put_f32_le(*val);
25871 }
25872 __tmp.put_f32_le(self.body_roll_rate);
25873 __tmp.put_f32_le(self.body_pitch_rate);
25874 __tmp.put_f32_le(self.body_yaw_rate);
25875 __tmp.put_f32_le(self.thrust);
25876 __tmp.put_u8(self.target_system);
25877 __tmp.put_u8(self.target_component);
25878 __tmp.put_u8(self.type_mask.bits());
25879 for val in &self.thrust_body {
25880 __tmp.put_f32_le(*val);
25881 }
25882 if matches!(version, MavlinkVersion::V2) {
25883 let len = __tmp.len();
25884 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25885 } else {
25886 __tmp.len()
25887 }
25888 }
25889}
25890#[doc = "id: 31"]
25891#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
25892#[derive(Debug, Clone, PartialEq)]
25893#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25894#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25895pub struct ATTITUDE_QUATERNION_DATA {
25896 #[doc = "Timestamp (time since system boot)."]
25897 pub time_boot_ms: u32,
25898 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
25899 pub q1: f32,
25900 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
25901 pub q2: f32,
25902 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
25903 pub q3: f32,
25904 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
25905 pub q4: f32,
25906 #[doc = "Roll angular speed"]
25907 pub rollspeed: f32,
25908 #[doc = "Pitch angular speed"]
25909 pub pitchspeed: f32,
25910 #[doc = "Yaw angular speed"]
25911 pub yawspeed: f32,
25912 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
25913 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25914 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25915 pub repr_offset_q: [f32; 4],
25916}
25917impl ATTITUDE_QUATERNION_DATA {
25918 pub const ENCODED_LEN: usize = 48usize;
25919 pub const DEFAULT: Self = Self {
25920 time_boot_ms: 0_u32,
25921 q1: 0.0_f32,
25922 q2: 0.0_f32,
25923 q3: 0.0_f32,
25924 q4: 0.0_f32,
25925 rollspeed: 0.0_f32,
25926 pitchspeed: 0.0_f32,
25927 yawspeed: 0.0_f32,
25928 repr_offset_q: [0.0_f32; 4usize],
25929 };
25930 #[cfg(feature = "arbitrary")]
25931 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25932 use arbitrary::{Arbitrary, Unstructured};
25933 let mut buf = [0u8; 1024];
25934 rng.fill_bytes(&mut buf);
25935 let mut unstructured = Unstructured::new(&buf);
25936 Self::arbitrary(&mut unstructured).unwrap_or_default()
25937 }
25938}
25939impl Default for ATTITUDE_QUATERNION_DATA {
25940 fn default() -> Self {
25941 Self::DEFAULT.clone()
25942 }
25943}
25944impl MessageData for ATTITUDE_QUATERNION_DATA {
25945 type Message = MavMessage;
25946 const ID: u32 = 31u32;
25947 const NAME: &'static str = "ATTITUDE_QUATERNION";
25948 const EXTRA_CRC: u8 = 246u8;
25949 const ENCODED_LEN: usize = 48usize;
25950 fn deser(
25951 _version: MavlinkVersion,
25952 __input: &[u8],
25953 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25954 let avail_len = __input.len();
25955 let mut payload_buf = [0; Self::ENCODED_LEN];
25956 let mut buf = if avail_len < Self::ENCODED_LEN {
25957 payload_buf[0..avail_len].copy_from_slice(__input);
25958 Bytes::new(&payload_buf)
25959 } else {
25960 Bytes::new(__input)
25961 };
25962 let mut __struct = Self::default();
25963 __struct.time_boot_ms = buf.get_u32_le();
25964 __struct.q1 = buf.get_f32_le();
25965 __struct.q2 = buf.get_f32_le();
25966 __struct.q3 = buf.get_f32_le();
25967 __struct.q4 = buf.get_f32_le();
25968 __struct.rollspeed = buf.get_f32_le();
25969 __struct.pitchspeed = buf.get_f32_le();
25970 __struct.yawspeed = buf.get_f32_le();
25971 for v in &mut __struct.repr_offset_q {
25972 let val = buf.get_f32_le();
25973 *v = val;
25974 }
25975 Ok(__struct)
25976 }
25977 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25978 let mut __tmp = BytesMut::new(bytes);
25979 #[allow(clippy::absurd_extreme_comparisons)]
25980 #[allow(unused_comparisons)]
25981 if __tmp.remaining() < Self::ENCODED_LEN {
25982 panic!(
25983 "buffer is too small (need {} bytes, but got {})",
25984 Self::ENCODED_LEN,
25985 __tmp.remaining(),
25986 )
25987 }
25988 __tmp.put_u32_le(self.time_boot_ms);
25989 __tmp.put_f32_le(self.q1);
25990 __tmp.put_f32_le(self.q2);
25991 __tmp.put_f32_le(self.q3);
25992 __tmp.put_f32_le(self.q4);
25993 __tmp.put_f32_le(self.rollspeed);
25994 __tmp.put_f32_le(self.pitchspeed);
25995 __tmp.put_f32_le(self.yawspeed);
25996 for val in &self.repr_offset_q {
25997 __tmp.put_f32_le(*val);
25998 }
25999 if matches!(version, MavlinkVersion::V2) {
26000 let len = __tmp.len();
26001 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26002 } else {
26003 __tmp.len()
26004 }
26005 }
26006}
26007#[doc = "id: 264"]
26008#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
26009#[derive(Debug, Clone, PartialEq)]
26010#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26011#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26012pub struct FLIGHT_INFORMATION_DATA {
26013 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
26014 pub arming_time_utc: u64,
26015 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
26016 pub takeoff_time_utc: u64,
26017 #[doc = "Flight number. Note, field is misnamed UUID."]
26018 pub flight_uuid: u64,
26019 #[doc = "Timestamp (time since system boot)."]
26020 pub time_boot_ms: u32,
26021 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
26022 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26023 pub landing_time: u32,
26024}
26025impl FLIGHT_INFORMATION_DATA {
26026 pub const ENCODED_LEN: usize = 32usize;
26027 pub const DEFAULT: Self = Self {
26028 arming_time_utc: 0_u64,
26029 takeoff_time_utc: 0_u64,
26030 flight_uuid: 0_u64,
26031 time_boot_ms: 0_u32,
26032 landing_time: 0_u32,
26033 };
26034 #[cfg(feature = "arbitrary")]
26035 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26036 use arbitrary::{Arbitrary, Unstructured};
26037 let mut buf = [0u8; 1024];
26038 rng.fill_bytes(&mut buf);
26039 let mut unstructured = Unstructured::new(&buf);
26040 Self::arbitrary(&mut unstructured).unwrap_or_default()
26041 }
26042}
26043impl Default for FLIGHT_INFORMATION_DATA {
26044 fn default() -> Self {
26045 Self::DEFAULT.clone()
26046 }
26047}
26048impl MessageData for FLIGHT_INFORMATION_DATA {
26049 type Message = MavMessage;
26050 const ID: u32 = 264u32;
26051 const NAME: &'static str = "FLIGHT_INFORMATION";
26052 const EXTRA_CRC: u8 = 49u8;
26053 const ENCODED_LEN: usize = 32usize;
26054 fn deser(
26055 _version: MavlinkVersion,
26056 __input: &[u8],
26057 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26058 let avail_len = __input.len();
26059 let mut payload_buf = [0; Self::ENCODED_LEN];
26060 let mut buf = if avail_len < Self::ENCODED_LEN {
26061 payload_buf[0..avail_len].copy_from_slice(__input);
26062 Bytes::new(&payload_buf)
26063 } else {
26064 Bytes::new(__input)
26065 };
26066 let mut __struct = Self::default();
26067 __struct.arming_time_utc = buf.get_u64_le();
26068 __struct.takeoff_time_utc = buf.get_u64_le();
26069 __struct.flight_uuid = buf.get_u64_le();
26070 __struct.time_boot_ms = buf.get_u32_le();
26071 __struct.landing_time = buf.get_u32_le();
26072 Ok(__struct)
26073 }
26074 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26075 let mut __tmp = BytesMut::new(bytes);
26076 #[allow(clippy::absurd_extreme_comparisons)]
26077 #[allow(unused_comparisons)]
26078 if __tmp.remaining() < Self::ENCODED_LEN {
26079 panic!(
26080 "buffer is too small (need {} bytes, but got {})",
26081 Self::ENCODED_LEN,
26082 __tmp.remaining(),
26083 )
26084 }
26085 __tmp.put_u64_le(self.arming_time_utc);
26086 __tmp.put_u64_le(self.takeoff_time_utc);
26087 __tmp.put_u64_le(self.flight_uuid);
26088 __tmp.put_u32_le(self.time_boot_ms);
26089 __tmp.put_u32_le(self.landing_time);
26090 if matches!(version, MavlinkVersion::V2) {
26091 let len = __tmp.len();
26092 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26093 } else {
26094 __tmp.len()
26095 }
26096 }
26097}
26098#[doc = "id: 114"]
26099#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
26100#[derive(Debug, Clone, PartialEq)]
26101#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26102#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26103pub struct HIL_OPTICAL_FLOW_DATA {
26104 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26105 pub time_usec: u64,
26106 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
26107 pub integration_time_us: u32,
26108 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
26109 pub integrated_x: f32,
26110 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
26111 pub integrated_y: f32,
26112 #[doc = "RH rotation around X axis"]
26113 pub integrated_xgyro: f32,
26114 #[doc = "RH rotation around Y axis"]
26115 pub integrated_ygyro: f32,
26116 #[doc = "RH rotation around Z axis"]
26117 pub integrated_zgyro: f32,
26118 #[doc = "Time since the distance was sampled."]
26119 pub time_delta_distance_us: u32,
26120 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
26121 pub distance: f32,
26122 #[doc = "Temperature"]
26123 pub temperature: i16,
26124 #[doc = "Sensor ID"]
26125 pub sensor_id: u8,
26126 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
26127 pub quality: u8,
26128}
26129impl HIL_OPTICAL_FLOW_DATA {
26130 pub const ENCODED_LEN: usize = 44usize;
26131 pub const DEFAULT: Self = Self {
26132 time_usec: 0_u64,
26133 integration_time_us: 0_u32,
26134 integrated_x: 0.0_f32,
26135 integrated_y: 0.0_f32,
26136 integrated_xgyro: 0.0_f32,
26137 integrated_ygyro: 0.0_f32,
26138 integrated_zgyro: 0.0_f32,
26139 time_delta_distance_us: 0_u32,
26140 distance: 0.0_f32,
26141 temperature: 0_i16,
26142 sensor_id: 0_u8,
26143 quality: 0_u8,
26144 };
26145 #[cfg(feature = "arbitrary")]
26146 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26147 use arbitrary::{Arbitrary, Unstructured};
26148 let mut buf = [0u8; 1024];
26149 rng.fill_bytes(&mut buf);
26150 let mut unstructured = Unstructured::new(&buf);
26151 Self::arbitrary(&mut unstructured).unwrap_or_default()
26152 }
26153}
26154impl Default for HIL_OPTICAL_FLOW_DATA {
26155 fn default() -> Self {
26156 Self::DEFAULT.clone()
26157 }
26158}
26159impl MessageData for HIL_OPTICAL_FLOW_DATA {
26160 type Message = MavMessage;
26161 const ID: u32 = 114u32;
26162 const NAME: &'static str = "HIL_OPTICAL_FLOW";
26163 const EXTRA_CRC: u8 = 237u8;
26164 const ENCODED_LEN: usize = 44usize;
26165 fn deser(
26166 _version: MavlinkVersion,
26167 __input: &[u8],
26168 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26169 let avail_len = __input.len();
26170 let mut payload_buf = [0; Self::ENCODED_LEN];
26171 let mut buf = if avail_len < Self::ENCODED_LEN {
26172 payload_buf[0..avail_len].copy_from_slice(__input);
26173 Bytes::new(&payload_buf)
26174 } else {
26175 Bytes::new(__input)
26176 };
26177 let mut __struct = Self::default();
26178 __struct.time_usec = buf.get_u64_le();
26179 __struct.integration_time_us = buf.get_u32_le();
26180 __struct.integrated_x = buf.get_f32_le();
26181 __struct.integrated_y = buf.get_f32_le();
26182 __struct.integrated_xgyro = buf.get_f32_le();
26183 __struct.integrated_ygyro = buf.get_f32_le();
26184 __struct.integrated_zgyro = buf.get_f32_le();
26185 __struct.time_delta_distance_us = buf.get_u32_le();
26186 __struct.distance = buf.get_f32_le();
26187 __struct.temperature = buf.get_i16_le();
26188 __struct.sensor_id = buf.get_u8();
26189 __struct.quality = buf.get_u8();
26190 Ok(__struct)
26191 }
26192 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26193 let mut __tmp = BytesMut::new(bytes);
26194 #[allow(clippy::absurd_extreme_comparisons)]
26195 #[allow(unused_comparisons)]
26196 if __tmp.remaining() < Self::ENCODED_LEN {
26197 panic!(
26198 "buffer is too small (need {} bytes, but got {})",
26199 Self::ENCODED_LEN,
26200 __tmp.remaining(),
26201 )
26202 }
26203 __tmp.put_u64_le(self.time_usec);
26204 __tmp.put_u32_le(self.integration_time_us);
26205 __tmp.put_f32_le(self.integrated_x);
26206 __tmp.put_f32_le(self.integrated_y);
26207 __tmp.put_f32_le(self.integrated_xgyro);
26208 __tmp.put_f32_le(self.integrated_ygyro);
26209 __tmp.put_f32_le(self.integrated_zgyro);
26210 __tmp.put_u32_le(self.time_delta_distance_us);
26211 __tmp.put_f32_le(self.distance);
26212 __tmp.put_i16_le(self.temperature);
26213 __tmp.put_u8(self.sensor_id);
26214 __tmp.put_u8(self.quality);
26215 if matches!(version, MavlinkVersion::V2) {
26216 let len = __tmp.len();
26217 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26218 } else {
26219 __tmp.len()
26220 }
26221 }
26222}
26223#[doc = "id: 103"]
26224#[doc = "Speed estimate from a vision source."]
26225#[derive(Debug, Clone, PartialEq)]
26226#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26227#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26228pub struct VISION_SPEED_ESTIMATE_DATA {
26229 #[doc = "Timestamp (UNIX time or time since system boot)"]
26230 pub usec: u64,
26231 #[doc = "Global X speed"]
26232 pub x: f32,
26233 #[doc = "Global Y speed"]
26234 pub y: f32,
26235 #[doc = "Global Z speed"]
26236 pub z: f32,
26237 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
26238 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26239 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26240 pub covariance: [f32; 9],
26241 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
26242 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26243 pub reset_counter: u8,
26244}
26245impl VISION_SPEED_ESTIMATE_DATA {
26246 pub const ENCODED_LEN: usize = 57usize;
26247 pub const DEFAULT: Self = Self {
26248 usec: 0_u64,
26249 x: 0.0_f32,
26250 y: 0.0_f32,
26251 z: 0.0_f32,
26252 covariance: [0.0_f32; 9usize],
26253 reset_counter: 0_u8,
26254 };
26255 #[cfg(feature = "arbitrary")]
26256 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26257 use arbitrary::{Arbitrary, Unstructured};
26258 let mut buf = [0u8; 1024];
26259 rng.fill_bytes(&mut buf);
26260 let mut unstructured = Unstructured::new(&buf);
26261 Self::arbitrary(&mut unstructured).unwrap_or_default()
26262 }
26263}
26264impl Default for VISION_SPEED_ESTIMATE_DATA {
26265 fn default() -> Self {
26266 Self::DEFAULT.clone()
26267 }
26268}
26269impl MessageData for VISION_SPEED_ESTIMATE_DATA {
26270 type Message = MavMessage;
26271 const ID: u32 = 103u32;
26272 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
26273 const EXTRA_CRC: u8 = 208u8;
26274 const ENCODED_LEN: usize = 57usize;
26275 fn deser(
26276 _version: MavlinkVersion,
26277 __input: &[u8],
26278 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26279 let avail_len = __input.len();
26280 let mut payload_buf = [0; Self::ENCODED_LEN];
26281 let mut buf = if avail_len < Self::ENCODED_LEN {
26282 payload_buf[0..avail_len].copy_from_slice(__input);
26283 Bytes::new(&payload_buf)
26284 } else {
26285 Bytes::new(__input)
26286 };
26287 let mut __struct = Self::default();
26288 __struct.usec = buf.get_u64_le();
26289 __struct.x = buf.get_f32_le();
26290 __struct.y = buf.get_f32_le();
26291 __struct.z = buf.get_f32_le();
26292 for v in &mut __struct.covariance {
26293 let val = buf.get_f32_le();
26294 *v = val;
26295 }
26296 __struct.reset_counter = buf.get_u8();
26297 Ok(__struct)
26298 }
26299 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26300 let mut __tmp = BytesMut::new(bytes);
26301 #[allow(clippy::absurd_extreme_comparisons)]
26302 #[allow(unused_comparisons)]
26303 if __tmp.remaining() < Self::ENCODED_LEN {
26304 panic!(
26305 "buffer is too small (need {} bytes, but got {})",
26306 Self::ENCODED_LEN,
26307 __tmp.remaining(),
26308 )
26309 }
26310 __tmp.put_u64_le(self.usec);
26311 __tmp.put_f32_le(self.x);
26312 __tmp.put_f32_le(self.y);
26313 __tmp.put_f32_le(self.z);
26314 for val in &self.covariance {
26315 __tmp.put_f32_le(*val);
26316 }
26317 __tmp.put_u8(self.reset_counter);
26318 if matches!(version, MavlinkVersion::V2) {
26319 let len = __tmp.len();
26320 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26321 } else {
26322 __tmp.len()
26323 }
26324 }
26325}
26326#[doc = "id: 235"]
26327#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
26328#[derive(Debug, Clone, PartialEq)]
26329#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26330#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26331pub struct HIGH_LATENCY2_DATA {
26332 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
26333 pub timestamp: u32,
26334 #[doc = "Latitude"]
26335 pub latitude: i32,
26336 #[doc = "Longitude"]
26337 pub longitude: i32,
26338 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
26339 pub custom_mode: u16,
26340 #[doc = "Altitude above mean sea level"]
26341 pub altitude: i16,
26342 #[doc = "Altitude setpoint"]
26343 pub target_altitude: i16,
26344 #[doc = "Distance to target waypoint or position"]
26345 pub target_distance: u16,
26346 #[doc = "Current waypoint number"]
26347 pub wp_num: u16,
26348 #[doc = "Bitmap of failure flags."]
26349 pub failure_flags: HlFailureFlag,
26350 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
26351 pub mavtype: MavType,
26352 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
26353 pub autopilot: MavAutopilot,
26354 #[doc = "Heading"]
26355 pub heading: u8,
26356 #[doc = "Heading setpoint"]
26357 pub target_heading: u8,
26358 #[doc = "Throttle"]
26359 pub throttle: u8,
26360 #[doc = "Airspeed"]
26361 pub airspeed: u8,
26362 #[doc = "Airspeed setpoint"]
26363 pub airspeed_sp: u8,
26364 #[doc = "Groundspeed"]
26365 pub groundspeed: u8,
26366 #[doc = "Windspeed"]
26367 pub windspeed: u8,
26368 #[doc = "Wind heading"]
26369 pub wind_heading: u8,
26370 #[doc = "Maximum error horizontal position since last message"]
26371 pub eph: u8,
26372 #[doc = "Maximum error vertical position since last message"]
26373 pub epv: u8,
26374 #[doc = "Air temperature"]
26375 pub temperature_air: i8,
26376 #[doc = "Maximum climb rate magnitude since last message"]
26377 pub climb_rate: i8,
26378 #[doc = "Battery level (-1 if field not provided)."]
26379 pub battery: i8,
26380 #[doc = "Field for custom payload."]
26381 pub custom0: i8,
26382 #[doc = "Field for custom payload."]
26383 pub custom1: i8,
26384 #[doc = "Field for custom payload."]
26385 pub custom2: i8,
26386}
26387impl HIGH_LATENCY2_DATA {
26388 pub const ENCODED_LEN: usize = 42usize;
26389 pub const DEFAULT: Self = Self {
26390 timestamp: 0_u32,
26391 latitude: 0_i32,
26392 longitude: 0_i32,
26393 custom_mode: 0_u16,
26394 altitude: 0_i16,
26395 target_altitude: 0_i16,
26396 target_distance: 0_u16,
26397 wp_num: 0_u16,
26398 failure_flags: HlFailureFlag::DEFAULT,
26399 mavtype: MavType::DEFAULT,
26400 autopilot: MavAutopilot::DEFAULT,
26401 heading: 0_u8,
26402 target_heading: 0_u8,
26403 throttle: 0_u8,
26404 airspeed: 0_u8,
26405 airspeed_sp: 0_u8,
26406 groundspeed: 0_u8,
26407 windspeed: 0_u8,
26408 wind_heading: 0_u8,
26409 eph: 0_u8,
26410 epv: 0_u8,
26411 temperature_air: 0_i8,
26412 climb_rate: 0_i8,
26413 battery: 0_i8,
26414 custom0: 0_i8,
26415 custom1: 0_i8,
26416 custom2: 0_i8,
26417 };
26418 #[cfg(feature = "arbitrary")]
26419 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26420 use arbitrary::{Arbitrary, Unstructured};
26421 let mut buf = [0u8; 1024];
26422 rng.fill_bytes(&mut buf);
26423 let mut unstructured = Unstructured::new(&buf);
26424 Self::arbitrary(&mut unstructured).unwrap_or_default()
26425 }
26426}
26427impl Default for HIGH_LATENCY2_DATA {
26428 fn default() -> Self {
26429 Self::DEFAULT.clone()
26430 }
26431}
26432impl MessageData for HIGH_LATENCY2_DATA {
26433 type Message = MavMessage;
26434 const ID: u32 = 235u32;
26435 const NAME: &'static str = "HIGH_LATENCY2";
26436 const EXTRA_CRC: u8 = 179u8;
26437 const ENCODED_LEN: usize = 42usize;
26438 fn deser(
26439 _version: MavlinkVersion,
26440 __input: &[u8],
26441 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26442 let avail_len = __input.len();
26443 let mut payload_buf = [0; Self::ENCODED_LEN];
26444 let mut buf = if avail_len < Self::ENCODED_LEN {
26445 payload_buf[0..avail_len].copy_from_slice(__input);
26446 Bytes::new(&payload_buf)
26447 } else {
26448 Bytes::new(__input)
26449 };
26450 let mut __struct = Self::default();
26451 __struct.timestamp = buf.get_u32_le();
26452 __struct.latitude = buf.get_i32_le();
26453 __struct.longitude = buf.get_i32_le();
26454 __struct.custom_mode = buf.get_u16_le();
26455 __struct.altitude = buf.get_i16_le();
26456 __struct.target_altitude = buf.get_i16_le();
26457 __struct.target_distance = buf.get_u16_le();
26458 __struct.wp_num = buf.get_u16_le();
26459 let tmp = buf.get_u16_le();
26460 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
26461 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
26462 flag_type: "HlFailureFlag",
26463 value: tmp as u32,
26464 })?;
26465 let tmp = buf.get_u8();
26466 __struct.mavtype =
26467 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26468 enum_type: "MavType",
26469 value: tmp as u32,
26470 })?;
26471 let tmp = buf.get_u8();
26472 __struct.autopilot =
26473 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26474 enum_type: "MavAutopilot",
26475 value: tmp as u32,
26476 })?;
26477 __struct.heading = buf.get_u8();
26478 __struct.target_heading = buf.get_u8();
26479 __struct.throttle = buf.get_u8();
26480 __struct.airspeed = buf.get_u8();
26481 __struct.airspeed_sp = buf.get_u8();
26482 __struct.groundspeed = buf.get_u8();
26483 __struct.windspeed = buf.get_u8();
26484 __struct.wind_heading = buf.get_u8();
26485 __struct.eph = buf.get_u8();
26486 __struct.epv = buf.get_u8();
26487 __struct.temperature_air = buf.get_i8();
26488 __struct.climb_rate = buf.get_i8();
26489 __struct.battery = buf.get_i8();
26490 __struct.custom0 = buf.get_i8();
26491 __struct.custom1 = buf.get_i8();
26492 __struct.custom2 = buf.get_i8();
26493 Ok(__struct)
26494 }
26495 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26496 let mut __tmp = BytesMut::new(bytes);
26497 #[allow(clippy::absurd_extreme_comparisons)]
26498 #[allow(unused_comparisons)]
26499 if __tmp.remaining() < Self::ENCODED_LEN {
26500 panic!(
26501 "buffer is too small (need {} bytes, but got {})",
26502 Self::ENCODED_LEN,
26503 __tmp.remaining(),
26504 )
26505 }
26506 __tmp.put_u32_le(self.timestamp);
26507 __tmp.put_i32_le(self.latitude);
26508 __tmp.put_i32_le(self.longitude);
26509 __tmp.put_u16_le(self.custom_mode);
26510 __tmp.put_i16_le(self.altitude);
26511 __tmp.put_i16_le(self.target_altitude);
26512 __tmp.put_u16_le(self.target_distance);
26513 __tmp.put_u16_le(self.wp_num);
26514 __tmp.put_u16_le(self.failure_flags.bits());
26515 __tmp.put_u8(self.mavtype as u8);
26516 __tmp.put_u8(self.autopilot as u8);
26517 __tmp.put_u8(self.heading);
26518 __tmp.put_u8(self.target_heading);
26519 __tmp.put_u8(self.throttle);
26520 __tmp.put_u8(self.airspeed);
26521 __tmp.put_u8(self.airspeed_sp);
26522 __tmp.put_u8(self.groundspeed);
26523 __tmp.put_u8(self.windspeed);
26524 __tmp.put_u8(self.wind_heading);
26525 __tmp.put_u8(self.eph);
26526 __tmp.put_u8(self.epv);
26527 __tmp.put_i8(self.temperature_air);
26528 __tmp.put_i8(self.climb_rate);
26529 __tmp.put_i8(self.battery);
26530 __tmp.put_i8(self.custom0);
26531 __tmp.put_i8(self.custom1);
26532 __tmp.put_i8(self.custom2);
26533 if matches!(version, MavlinkVersion::V2) {
26534 let len = __tmp.len();
26535 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26536 } else {
26537 __tmp.len()
26538 }
26539 }
26540}
26541#[doc = "id: 108"]
26542#[doc = "Status of simulation environment, if used."]
26543#[derive(Debug, Clone, PartialEq)]
26544#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26545#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26546pub struct SIM_STATE_DATA {
26547 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
26548 pub q1: f32,
26549 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
26550 pub q2: f32,
26551 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
26552 pub q3: f32,
26553 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
26554 pub q4: f32,
26555 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
26556 pub roll: f32,
26557 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
26558 pub pitch: f32,
26559 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
26560 pub yaw: f32,
26561 #[doc = "X acceleration"]
26562 pub xacc: f32,
26563 #[doc = "Y acceleration"]
26564 pub yacc: f32,
26565 #[doc = "Z acceleration"]
26566 pub zacc: f32,
26567 #[doc = "Angular speed around X axis"]
26568 pub xgyro: f32,
26569 #[doc = "Angular speed around Y axis"]
26570 pub ygyro: f32,
26571 #[doc = "Angular speed around Z axis"]
26572 pub zgyro: f32,
26573 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
26574 pub lat: f32,
26575 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
26576 pub lon: f32,
26577 #[doc = "Altitude"]
26578 pub alt: f32,
26579 #[doc = "Horizontal position standard deviation"]
26580 pub std_dev_horz: f32,
26581 #[doc = "Vertical position standard deviation"]
26582 pub std_dev_vert: f32,
26583 #[doc = "True velocity in north direction in earth-fixed NED frame"]
26584 pub vn: f32,
26585 #[doc = "True velocity in east direction in earth-fixed NED frame"]
26586 pub ve: f32,
26587 #[doc = "True velocity in down direction in earth-fixed NED frame"]
26588 pub vd: f32,
26589 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
26590 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26591 pub lat_int: i32,
26592 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
26593 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26594 pub lon_int: i32,
26595}
26596impl SIM_STATE_DATA {
26597 pub const ENCODED_LEN: usize = 92usize;
26598 pub const DEFAULT: Self = Self {
26599 q1: 0.0_f32,
26600 q2: 0.0_f32,
26601 q3: 0.0_f32,
26602 q4: 0.0_f32,
26603 roll: 0.0_f32,
26604 pitch: 0.0_f32,
26605 yaw: 0.0_f32,
26606 xacc: 0.0_f32,
26607 yacc: 0.0_f32,
26608 zacc: 0.0_f32,
26609 xgyro: 0.0_f32,
26610 ygyro: 0.0_f32,
26611 zgyro: 0.0_f32,
26612 lat: 0.0_f32,
26613 lon: 0.0_f32,
26614 alt: 0.0_f32,
26615 std_dev_horz: 0.0_f32,
26616 std_dev_vert: 0.0_f32,
26617 vn: 0.0_f32,
26618 ve: 0.0_f32,
26619 vd: 0.0_f32,
26620 lat_int: 0_i32,
26621 lon_int: 0_i32,
26622 };
26623 #[cfg(feature = "arbitrary")]
26624 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26625 use arbitrary::{Arbitrary, Unstructured};
26626 let mut buf = [0u8; 1024];
26627 rng.fill_bytes(&mut buf);
26628 let mut unstructured = Unstructured::new(&buf);
26629 Self::arbitrary(&mut unstructured).unwrap_or_default()
26630 }
26631}
26632impl Default for SIM_STATE_DATA {
26633 fn default() -> Self {
26634 Self::DEFAULT.clone()
26635 }
26636}
26637impl MessageData for SIM_STATE_DATA {
26638 type Message = MavMessage;
26639 const ID: u32 = 108u32;
26640 const NAME: &'static str = "SIM_STATE";
26641 const EXTRA_CRC: u8 = 32u8;
26642 const ENCODED_LEN: usize = 92usize;
26643 fn deser(
26644 _version: MavlinkVersion,
26645 __input: &[u8],
26646 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26647 let avail_len = __input.len();
26648 let mut payload_buf = [0; Self::ENCODED_LEN];
26649 let mut buf = if avail_len < Self::ENCODED_LEN {
26650 payload_buf[0..avail_len].copy_from_slice(__input);
26651 Bytes::new(&payload_buf)
26652 } else {
26653 Bytes::new(__input)
26654 };
26655 let mut __struct = Self::default();
26656 __struct.q1 = buf.get_f32_le();
26657 __struct.q2 = buf.get_f32_le();
26658 __struct.q3 = buf.get_f32_le();
26659 __struct.q4 = buf.get_f32_le();
26660 __struct.roll = buf.get_f32_le();
26661 __struct.pitch = buf.get_f32_le();
26662 __struct.yaw = buf.get_f32_le();
26663 __struct.xacc = buf.get_f32_le();
26664 __struct.yacc = buf.get_f32_le();
26665 __struct.zacc = buf.get_f32_le();
26666 __struct.xgyro = buf.get_f32_le();
26667 __struct.ygyro = buf.get_f32_le();
26668 __struct.zgyro = buf.get_f32_le();
26669 __struct.lat = buf.get_f32_le();
26670 __struct.lon = buf.get_f32_le();
26671 __struct.alt = buf.get_f32_le();
26672 __struct.std_dev_horz = buf.get_f32_le();
26673 __struct.std_dev_vert = buf.get_f32_le();
26674 __struct.vn = buf.get_f32_le();
26675 __struct.ve = buf.get_f32_le();
26676 __struct.vd = buf.get_f32_le();
26677 __struct.lat_int = buf.get_i32_le();
26678 __struct.lon_int = buf.get_i32_le();
26679 Ok(__struct)
26680 }
26681 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26682 let mut __tmp = BytesMut::new(bytes);
26683 #[allow(clippy::absurd_extreme_comparisons)]
26684 #[allow(unused_comparisons)]
26685 if __tmp.remaining() < Self::ENCODED_LEN {
26686 panic!(
26687 "buffer is too small (need {} bytes, but got {})",
26688 Self::ENCODED_LEN,
26689 __tmp.remaining(),
26690 )
26691 }
26692 __tmp.put_f32_le(self.q1);
26693 __tmp.put_f32_le(self.q2);
26694 __tmp.put_f32_le(self.q3);
26695 __tmp.put_f32_le(self.q4);
26696 __tmp.put_f32_le(self.roll);
26697 __tmp.put_f32_le(self.pitch);
26698 __tmp.put_f32_le(self.yaw);
26699 __tmp.put_f32_le(self.xacc);
26700 __tmp.put_f32_le(self.yacc);
26701 __tmp.put_f32_le(self.zacc);
26702 __tmp.put_f32_le(self.xgyro);
26703 __tmp.put_f32_le(self.ygyro);
26704 __tmp.put_f32_le(self.zgyro);
26705 __tmp.put_f32_le(self.lat);
26706 __tmp.put_f32_le(self.lon);
26707 __tmp.put_f32_le(self.alt);
26708 __tmp.put_f32_le(self.std_dev_horz);
26709 __tmp.put_f32_le(self.std_dev_vert);
26710 __tmp.put_f32_le(self.vn);
26711 __tmp.put_f32_le(self.ve);
26712 __tmp.put_f32_le(self.vd);
26713 __tmp.put_i32_le(self.lat_int);
26714 __tmp.put_i32_le(self.lon_int);
26715 if matches!(version, MavlinkVersion::V2) {
26716 let len = __tmp.len();
26717 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26718 } else {
26719 __tmp.len()
26720 }
26721 }
26722}
26723#[doc = "id: 12905"]
26724#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
26725#[derive(Debug, Clone, PartialEq)]
26726#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26727#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26728pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
26729 #[doc = "System ID (0 for broadcast)."]
26730 pub target_system: u8,
26731 #[doc = "Component ID (0 for broadcast)."]
26732 pub target_component: u8,
26733 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
26734 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26735 pub id_or_mac: [u8; 20],
26736 #[doc = "Indicates the type of the operator_id field."]
26737 pub operator_id_type: MavOdidOperatorIdType,
26738 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
26739 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26740 pub operator_id: [u8; 20],
26741}
26742impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
26743 pub const ENCODED_LEN: usize = 43usize;
26744 pub const DEFAULT: Self = Self {
26745 target_system: 0_u8,
26746 target_component: 0_u8,
26747 id_or_mac: [0_u8; 20usize],
26748 operator_id_type: MavOdidOperatorIdType::DEFAULT,
26749 operator_id: [0_u8; 20usize],
26750 };
26751 #[cfg(feature = "arbitrary")]
26752 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26753 use arbitrary::{Arbitrary, Unstructured};
26754 let mut buf = [0u8; 1024];
26755 rng.fill_bytes(&mut buf);
26756 let mut unstructured = Unstructured::new(&buf);
26757 Self::arbitrary(&mut unstructured).unwrap_or_default()
26758 }
26759}
26760impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
26761 fn default() -> Self {
26762 Self::DEFAULT.clone()
26763 }
26764}
26765impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
26766 type Message = MavMessage;
26767 const ID: u32 = 12905u32;
26768 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
26769 const EXTRA_CRC: u8 = 49u8;
26770 const ENCODED_LEN: usize = 43usize;
26771 fn deser(
26772 _version: MavlinkVersion,
26773 __input: &[u8],
26774 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26775 let avail_len = __input.len();
26776 let mut payload_buf = [0; Self::ENCODED_LEN];
26777 let mut buf = if avail_len < Self::ENCODED_LEN {
26778 payload_buf[0..avail_len].copy_from_slice(__input);
26779 Bytes::new(&payload_buf)
26780 } else {
26781 Bytes::new(__input)
26782 };
26783 let mut __struct = Self::default();
26784 __struct.target_system = buf.get_u8();
26785 __struct.target_component = buf.get_u8();
26786 for v in &mut __struct.id_or_mac {
26787 let val = buf.get_u8();
26788 *v = val;
26789 }
26790 let tmp = buf.get_u8();
26791 __struct.operator_id_type =
26792 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26793 enum_type: "MavOdidOperatorIdType",
26794 value: tmp as u32,
26795 })?;
26796 for v in &mut __struct.operator_id {
26797 let val = buf.get_u8();
26798 *v = val;
26799 }
26800 Ok(__struct)
26801 }
26802 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26803 let mut __tmp = BytesMut::new(bytes);
26804 #[allow(clippy::absurd_extreme_comparisons)]
26805 #[allow(unused_comparisons)]
26806 if __tmp.remaining() < Self::ENCODED_LEN {
26807 panic!(
26808 "buffer is too small (need {} bytes, but got {})",
26809 Self::ENCODED_LEN,
26810 __tmp.remaining(),
26811 )
26812 }
26813 __tmp.put_u8(self.target_system);
26814 __tmp.put_u8(self.target_component);
26815 for val in &self.id_or_mac {
26816 __tmp.put_u8(*val);
26817 }
26818 __tmp.put_u8(self.operator_id_type as u8);
26819 for val in &self.operator_id {
26820 __tmp.put_u8(*val);
26821 }
26822 if matches!(version, MavlinkVersion::V2) {
26823 let len = __tmp.len();
26824 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26825 } else {
26826 __tmp.len()
26827 }
26828 }
26829}
26830#[doc = "id: 50"]
26831#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
26832#[derive(Debug, Clone, PartialEq)]
26833#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26834#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26835pub struct PARAM_MAP_RC_DATA {
26836 #[doc = "Initial parameter value"]
26837 pub param_value0: f32,
26838 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
26839 pub scale: f32,
26840 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
26841 pub param_value_min: f32,
26842 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
26843 pub param_value_max: f32,
26844 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
26845 pub param_index: i16,
26846 #[doc = "System ID"]
26847 pub target_system: u8,
26848 #[doc = "Component ID"]
26849 pub target_component: u8,
26850 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
26851 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26852 pub param_id: [u8; 16],
26853 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
26854 pub parameter_rc_channel_index: u8,
26855}
26856impl PARAM_MAP_RC_DATA {
26857 pub const ENCODED_LEN: usize = 37usize;
26858 pub const DEFAULT: Self = Self {
26859 param_value0: 0.0_f32,
26860 scale: 0.0_f32,
26861 param_value_min: 0.0_f32,
26862 param_value_max: 0.0_f32,
26863 param_index: 0_i16,
26864 target_system: 0_u8,
26865 target_component: 0_u8,
26866 param_id: [0_u8; 16usize],
26867 parameter_rc_channel_index: 0_u8,
26868 };
26869 #[cfg(feature = "arbitrary")]
26870 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26871 use arbitrary::{Arbitrary, Unstructured};
26872 let mut buf = [0u8; 1024];
26873 rng.fill_bytes(&mut buf);
26874 let mut unstructured = Unstructured::new(&buf);
26875 Self::arbitrary(&mut unstructured).unwrap_or_default()
26876 }
26877}
26878impl Default for PARAM_MAP_RC_DATA {
26879 fn default() -> Self {
26880 Self::DEFAULT.clone()
26881 }
26882}
26883impl MessageData for PARAM_MAP_RC_DATA {
26884 type Message = MavMessage;
26885 const ID: u32 = 50u32;
26886 const NAME: &'static str = "PARAM_MAP_RC";
26887 const EXTRA_CRC: u8 = 78u8;
26888 const ENCODED_LEN: usize = 37usize;
26889 fn deser(
26890 _version: MavlinkVersion,
26891 __input: &[u8],
26892 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26893 let avail_len = __input.len();
26894 let mut payload_buf = [0; Self::ENCODED_LEN];
26895 let mut buf = if avail_len < Self::ENCODED_LEN {
26896 payload_buf[0..avail_len].copy_from_slice(__input);
26897 Bytes::new(&payload_buf)
26898 } else {
26899 Bytes::new(__input)
26900 };
26901 let mut __struct = Self::default();
26902 __struct.param_value0 = buf.get_f32_le();
26903 __struct.scale = buf.get_f32_le();
26904 __struct.param_value_min = buf.get_f32_le();
26905 __struct.param_value_max = buf.get_f32_le();
26906 __struct.param_index = buf.get_i16_le();
26907 __struct.target_system = buf.get_u8();
26908 __struct.target_component = buf.get_u8();
26909 for v in &mut __struct.param_id {
26910 let val = buf.get_u8();
26911 *v = val;
26912 }
26913 __struct.parameter_rc_channel_index = buf.get_u8();
26914 Ok(__struct)
26915 }
26916 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26917 let mut __tmp = BytesMut::new(bytes);
26918 #[allow(clippy::absurd_extreme_comparisons)]
26919 #[allow(unused_comparisons)]
26920 if __tmp.remaining() < Self::ENCODED_LEN {
26921 panic!(
26922 "buffer is too small (need {} bytes, but got {})",
26923 Self::ENCODED_LEN,
26924 __tmp.remaining(),
26925 )
26926 }
26927 __tmp.put_f32_le(self.param_value0);
26928 __tmp.put_f32_le(self.scale);
26929 __tmp.put_f32_le(self.param_value_min);
26930 __tmp.put_f32_le(self.param_value_max);
26931 __tmp.put_i16_le(self.param_index);
26932 __tmp.put_u8(self.target_system);
26933 __tmp.put_u8(self.target_component);
26934 for val in &self.param_id {
26935 __tmp.put_u8(*val);
26936 }
26937 __tmp.put_u8(self.parameter_rc_channel_index);
26938 if matches!(version, MavlinkVersion::V2) {
26939 let len = __tmp.len();
26940 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26941 } else {
26942 __tmp.len()
26943 }
26944 }
26945}
26946#[doc = "id: 260"]
26947#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
26948#[derive(Debug, Clone, PartialEq)]
26949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26950#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26951pub struct CAMERA_SETTINGS_DATA {
26952 #[doc = "Timestamp (time since system boot)."]
26953 pub time_boot_ms: u32,
26954 #[doc = "Camera mode"]
26955 pub mode_id: CameraMode,
26956 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
26957 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26958 pub zoomLevel: f32,
26959 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
26960 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26961 pub focusLevel: f32,
26962 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
26963 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26964 pub camera_device_id: u8,
26965}
26966impl CAMERA_SETTINGS_DATA {
26967 pub const ENCODED_LEN: usize = 14usize;
26968 pub const DEFAULT: Self = Self {
26969 time_boot_ms: 0_u32,
26970 mode_id: CameraMode::DEFAULT,
26971 zoomLevel: 0.0_f32,
26972 focusLevel: 0.0_f32,
26973 camera_device_id: 0_u8,
26974 };
26975 #[cfg(feature = "arbitrary")]
26976 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26977 use arbitrary::{Arbitrary, Unstructured};
26978 let mut buf = [0u8; 1024];
26979 rng.fill_bytes(&mut buf);
26980 let mut unstructured = Unstructured::new(&buf);
26981 Self::arbitrary(&mut unstructured).unwrap_or_default()
26982 }
26983}
26984impl Default for CAMERA_SETTINGS_DATA {
26985 fn default() -> Self {
26986 Self::DEFAULT.clone()
26987 }
26988}
26989impl MessageData for CAMERA_SETTINGS_DATA {
26990 type Message = MavMessage;
26991 const ID: u32 = 260u32;
26992 const NAME: &'static str = "CAMERA_SETTINGS";
26993 const EXTRA_CRC: u8 = 146u8;
26994 const ENCODED_LEN: usize = 14usize;
26995 fn deser(
26996 _version: MavlinkVersion,
26997 __input: &[u8],
26998 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26999 let avail_len = __input.len();
27000 let mut payload_buf = [0; Self::ENCODED_LEN];
27001 let mut buf = if avail_len < Self::ENCODED_LEN {
27002 payload_buf[0..avail_len].copy_from_slice(__input);
27003 Bytes::new(&payload_buf)
27004 } else {
27005 Bytes::new(__input)
27006 };
27007 let mut __struct = Self::default();
27008 __struct.time_boot_ms = buf.get_u32_le();
27009 let tmp = buf.get_u8();
27010 __struct.mode_id =
27011 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27012 enum_type: "CameraMode",
27013 value: tmp as u32,
27014 })?;
27015 __struct.zoomLevel = buf.get_f32_le();
27016 __struct.focusLevel = buf.get_f32_le();
27017 __struct.camera_device_id = buf.get_u8();
27018 Ok(__struct)
27019 }
27020 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27021 let mut __tmp = BytesMut::new(bytes);
27022 #[allow(clippy::absurd_extreme_comparisons)]
27023 #[allow(unused_comparisons)]
27024 if __tmp.remaining() < Self::ENCODED_LEN {
27025 panic!(
27026 "buffer is too small (need {} bytes, but got {})",
27027 Self::ENCODED_LEN,
27028 __tmp.remaining(),
27029 )
27030 }
27031 __tmp.put_u32_le(self.time_boot_ms);
27032 __tmp.put_u8(self.mode_id as u8);
27033 __tmp.put_f32_le(self.zoomLevel);
27034 __tmp.put_f32_le(self.focusLevel);
27035 __tmp.put_u8(self.camera_device_id);
27036 if matches!(version, MavlinkVersion::V2) {
27037 let len = __tmp.len();
27038 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27039 } else {
27040 __tmp.len()
27041 }
27042 }
27043}
27044#[doc = "id: 43"]
27045#[doc = "Request the overall list of mission items from the system/component."]
27046#[derive(Debug, Clone, PartialEq)]
27047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27049pub struct MISSION_REQUEST_LIST_DATA {
27050 #[doc = "System ID"]
27051 pub target_system: u8,
27052 #[doc = "Component ID"]
27053 pub target_component: u8,
27054 #[doc = "Mission type."]
27055 #[cfg_attr(feature = "serde", serde(default))]
27056 pub mission_type: MavMissionType,
27057}
27058impl MISSION_REQUEST_LIST_DATA {
27059 pub const ENCODED_LEN: usize = 3usize;
27060 pub const DEFAULT: Self = Self {
27061 target_system: 0_u8,
27062 target_component: 0_u8,
27063 mission_type: MavMissionType::DEFAULT,
27064 };
27065 #[cfg(feature = "arbitrary")]
27066 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27067 use arbitrary::{Arbitrary, Unstructured};
27068 let mut buf = [0u8; 1024];
27069 rng.fill_bytes(&mut buf);
27070 let mut unstructured = Unstructured::new(&buf);
27071 Self::arbitrary(&mut unstructured).unwrap_or_default()
27072 }
27073}
27074impl Default for MISSION_REQUEST_LIST_DATA {
27075 fn default() -> Self {
27076 Self::DEFAULT.clone()
27077 }
27078}
27079impl MessageData for MISSION_REQUEST_LIST_DATA {
27080 type Message = MavMessage;
27081 const ID: u32 = 43u32;
27082 const NAME: &'static str = "MISSION_REQUEST_LIST";
27083 const EXTRA_CRC: u8 = 132u8;
27084 const ENCODED_LEN: usize = 3usize;
27085 fn deser(
27086 _version: MavlinkVersion,
27087 __input: &[u8],
27088 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27089 let avail_len = __input.len();
27090 let mut payload_buf = [0; Self::ENCODED_LEN];
27091 let mut buf = if avail_len < Self::ENCODED_LEN {
27092 payload_buf[0..avail_len].copy_from_slice(__input);
27093 Bytes::new(&payload_buf)
27094 } else {
27095 Bytes::new(__input)
27096 };
27097 let mut __struct = Self::default();
27098 __struct.target_system = buf.get_u8();
27099 __struct.target_component = buf.get_u8();
27100 let tmp = buf.get_u8();
27101 __struct.mission_type =
27102 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27103 enum_type: "MavMissionType",
27104 value: tmp as u32,
27105 })?;
27106 Ok(__struct)
27107 }
27108 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27109 let mut __tmp = BytesMut::new(bytes);
27110 #[allow(clippy::absurd_extreme_comparisons)]
27111 #[allow(unused_comparisons)]
27112 if __tmp.remaining() < Self::ENCODED_LEN {
27113 panic!(
27114 "buffer is too small (need {} bytes, but got {})",
27115 Self::ENCODED_LEN,
27116 __tmp.remaining(),
27117 )
27118 }
27119 __tmp.put_u8(self.target_system);
27120 __tmp.put_u8(self.target_component);
27121 __tmp.put_u8(self.mission_type as u8);
27122 if matches!(version, MavlinkVersion::V2) {
27123 let len = __tmp.len();
27124 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27125 } else {
27126 __tmp.len()
27127 }
27128 }
27129}
27130#[doc = "id: 285"]
27131#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
27132#[derive(Debug, Clone, PartialEq)]
27133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27134#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27135pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
27136 #[doc = "Timestamp (time since system boot)."]
27137 pub time_boot_ms: u32,
27138 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
27139 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27140 pub q: [f32; 4],
27141 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
27142 pub angular_velocity_x: f32,
27143 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
27144 pub angular_velocity_y: f32,
27145 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
27146 pub angular_velocity_z: f32,
27147 #[doc = "Failure flags (0 for no failure)"]
27148 pub failure_flags: GimbalDeviceErrorFlags,
27149 #[doc = "Current gimbal flags set."]
27150 pub flags: GimbalDeviceFlags,
27151 #[doc = "System ID"]
27152 pub target_system: u8,
27153 #[doc = "Component ID"]
27154 pub target_component: u8,
27155 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
27156 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27157 pub delta_yaw: f32,
27158 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
27159 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27160 pub delta_yaw_velocity: f32,
27161 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
27162 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27163 pub gimbal_device_id: u8,
27164}
27165impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
27166 pub const ENCODED_LEN: usize = 49usize;
27167 pub const DEFAULT: Self = Self {
27168 time_boot_ms: 0_u32,
27169 q: [0.0_f32; 4usize],
27170 angular_velocity_x: 0.0_f32,
27171 angular_velocity_y: 0.0_f32,
27172 angular_velocity_z: 0.0_f32,
27173 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
27174 flags: GimbalDeviceFlags::DEFAULT,
27175 target_system: 0_u8,
27176 target_component: 0_u8,
27177 delta_yaw: 0.0_f32,
27178 delta_yaw_velocity: 0.0_f32,
27179 gimbal_device_id: 0_u8,
27180 };
27181 #[cfg(feature = "arbitrary")]
27182 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27183 use arbitrary::{Arbitrary, Unstructured};
27184 let mut buf = [0u8; 1024];
27185 rng.fill_bytes(&mut buf);
27186 let mut unstructured = Unstructured::new(&buf);
27187 Self::arbitrary(&mut unstructured).unwrap_or_default()
27188 }
27189}
27190impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
27191 fn default() -> Self {
27192 Self::DEFAULT.clone()
27193 }
27194}
27195impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
27196 type Message = MavMessage;
27197 const ID: u32 = 285u32;
27198 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
27199 const EXTRA_CRC: u8 = 137u8;
27200 const ENCODED_LEN: usize = 49usize;
27201 fn deser(
27202 _version: MavlinkVersion,
27203 __input: &[u8],
27204 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27205 let avail_len = __input.len();
27206 let mut payload_buf = [0; Self::ENCODED_LEN];
27207 let mut buf = if avail_len < Self::ENCODED_LEN {
27208 payload_buf[0..avail_len].copy_from_slice(__input);
27209 Bytes::new(&payload_buf)
27210 } else {
27211 Bytes::new(__input)
27212 };
27213 let mut __struct = Self::default();
27214 __struct.time_boot_ms = buf.get_u32_le();
27215 for v in &mut __struct.q {
27216 let val = buf.get_f32_le();
27217 *v = val;
27218 }
27219 __struct.angular_velocity_x = buf.get_f32_le();
27220 __struct.angular_velocity_y = buf.get_f32_le();
27221 __struct.angular_velocity_z = buf.get_f32_le();
27222 let tmp = buf.get_u32_le();
27223 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
27224 tmp & GimbalDeviceErrorFlags::all().bits(),
27225 )
27226 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27227 flag_type: "GimbalDeviceErrorFlags",
27228 value: tmp as u32,
27229 })?;
27230 let tmp = buf.get_u16_le();
27231 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
27232 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27233 flag_type: "GimbalDeviceFlags",
27234 value: tmp as u32,
27235 })?;
27236 __struct.target_system = buf.get_u8();
27237 __struct.target_component = buf.get_u8();
27238 __struct.delta_yaw = buf.get_f32_le();
27239 __struct.delta_yaw_velocity = buf.get_f32_le();
27240 __struct.gimbal_device_id = buf.get_u8();
27241 Ok(__struct)
27242 }
27243 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27244 let mut __tmp = BytesMut::new(bytes);
27245 #[allow(clippy::absurd_extreme_comparisons)]
27246 #[allow(unused_comparisons)]
27247 if __tmp.remaining() < Self::ENCODED_LEN {
27248 panic!(
27249 "buffer is too small (need {} bytes, but got {})",
27250 Self::ENCODED_LEN,
27251 __tmp.remaining(),
27252 )
27253 }
27254 __tmp.put_u32_le(self.time_boot_ms);
27255 for val in &self.q {
27256 __tmp.put_f32_le(*val);
27257 }
27258 __tmp.put_f32_le(self.angular_velocity_x);
27259 __tmp.put_f32_le(self.angular_velocity_y);
27260 __tmp.put_f32_le(self.angular_velocity_z);
27261 __tmp.put_u32_le(self.failure_flags.bits());
27262 __tmp.put_u16_le(self.flags.bits());
27263 __tmp.put_u8(self.target_system);
27264 __tmp.put_u8(self.target_component);
27265 __tmp.put_f32_le(self.delta_yaw);
27266 __tmp.put_f32_le(self.delta_yaw_velocity);
27267 __tmp.put_u8(self.gimbal_device_id);
27268 if matches!(version, MavlinkVersion::V2) {
27269 let len = __tmp.len();
27270 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27271 } else {
27272 __tmp.len()
27273 }
27274 }
27275}
27276#[doc = "id: 35"]
27277#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
27278#[derive(Debug, Clone, PartialEq)]
27279#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27280#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27281pub struct RC_CHANNELS_RAW_DATA {
27282 #[doc = "Timestamp (time since system boot)."]
27283 pub time_boot_ms: u32,
27284 #[doc = "RC channel 1 value."]
27285 pub chan1_raw: u16,
27286 #[doc = "RC channel 2 value."]
27287 pub chan2_raw: u16,
27288 #[doc = "RC channel 3 value."]
27289 pub chan3_raw: u16,
27290 #[doc = "RC channel 4 value."]
27291 pub chan4_raw: u16,
27292 #[doc = "RC channel 5 value."]
27293 pub chan5_raw: u16,
27294 #[doc = "RC channel 6 value."]
27295 pub chan6_raw: u16,
27296 #[doc = "RC channel 7 value."]
27297 pub chan7_raw: u16,
27298 #[doc = "RC channel 8 value."]
27299 pub chan8_raw: u16,
27300 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
27301 pub port: u8,
27302 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
27303 pub rssi: u8,
27304}
27305impl RC_CHANNELS_RAW_DATA {
27306 pub const ENCODED_LEN: usize = 22usize;
27307 pub const DEFAULT: Self = Self {
27308 time_boot_ms: 0_u32,
27309 chan1_raw: 0_u16,
27310 chan2_raw: 0_u16,
27311 chan3_raw: 0_u16,
27312 chan4_raw: 0_u16,
27313 chan5_raw: 0_u16,
27314 chan6_raw: 0_u16,
27315 chan7_raw: 0_u16,
27316 chan8_raw: 0_u16,
27317 port: 0_u8,
27318 rssi: 0_u8,
27319 };
27320 #[cfg(feature = "arbitrary")]
27321 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27322 use arbitrary::{Arbitrary, Unstructured};
27323 let mut buf = [0u8; 1024];
27324 rng.fill_bytes(&mut buf);
27325 let mut unstructured = Unstructured::new(&buf);
27326 Self::arbitrary(&mut unstructured).unwrap_or_default()
27327 }
27328}
27329impl Default for RC_CHANNELS_RAW_DATA {
27330 fn default() -> Self {
27331 Self::DEFAULT.clone()
27332 }
27333}
27334impl MessageData for RC_CHANNELS_RAW_DATA {
27335 type Message = MavMessage;
27336 const ID: u32 = 35u32;
27337 const NAME: &'static str = "RC_CHANNELS_RAW";
27338 const EXTRA_CRC: u8 = 244u8;
27339 const ENCODED_LEN: usize = 22usize;
27340 fn deser(
27341 _version: MavlinkVersion,
27342 __input: &[u8],
27343 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27344 let avail_len = __input.len();
27345 let mut payload_buf = [0; Self::ENCODED_LEN];
27346 let mut buf = if avail_len < Self::ENCODED_LEN {
27347 payload_buf[0..avail_len].copy_from_slice(__input);
27348 Bytes::new(&payload_buf)
27349 } else {
27350 Bytes::new(__input)
27351 };
27352 let mut __struct = Self::default();
27353 __struct.time_boot_ms = buf.get_u32_le();
27354 __struct.chan1_raw = buf.get_u16_le();
27355 __struct.chan2_raw = buf.get_u16_le();
27356 __struct.chan3_raw = buf.get_u16_le();
27357 __struct.chan4_raw = buf.get_u16_le();
27358 __struct.chan5_raw = buf.get_u16_le();
27359 __struct.chan6_raw = buf.get_u16_le();
27360 __struct.chan7_raw = buf.get_u16_le();
27361 __struct.chan8_raw = buf.get_u16_le();
27362 __struct.port = buf.get_u8();
27363 __struct.rssi = buf.get_u8();
27364 Ok(__struct)
27365 }
27366 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27367 let mut __tmp = BytesMut::new(bytes);
27368 #[allow(clippy::absurd_extreme_comparisons)]
27369 #[allow(unused_comparisons)]
27370 if __tmp.remaining() < Self::ENCODED_LEN {
27371 panic!(
27372 "buffer is too small (need {} bytes, but got {})",
27373 Self::ENCODED_LEN,
27374 __tmp.remaining(),
27375 )
27376 }
27377 __tmp.put_u32_le(self.time_boot_ms);
27378 __tmp.put_u16_le(self.chan1_raw);
27379 __tmp.put_u16_le(self.chan2_raw);
27380 __tmp.put_u16_le(self.chan3_raw);
27381 __tmp.put_u16_le(self.chan4_raw);
27382 __tmp.put_u16_le(self.chan5_raw);
27383 __tmp.put_u16_le(self.chan6_raw);
27384 __tmp.put_u16_le(self.chan7_raw);
27385 __tmp.put_u16_le(self.chan8_raw);
27386 __tmp.put_u8(self.port);
27387 __tmp.put_u8(self.rssi);
27388 if matches!(version, MavlinkVersion::V2) {
27389 let len = __tmp.len();
27390 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27391 } else {
27392 __tmp.len()
27393 }
27394 }
27395}
27396#[doc = "id: 117"]
27397#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
27398#[derive(Debug, Clone, PartialEq)]
27399#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27400#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27401pub struct LOG_REQUEST_LIST_DATA {
27402 #[doc = "First log id (0 for first available)"]
27403 pub start: u16,
27404 #[doc = "Last log id (0xffff for last available)"]
27405 pub end: u16,
27406 #[doc = "System ID"]
27407 pub target_system: u8,
27408 #[doc = "Component ID"]
27409 pub target_component: u8,
27410}
27411impl LOG_REQUEST_LIST_DATA {
27412 pub const ENCODED_LEN: usize = 6usize;
27413 pub const DEFAULT: Self = Self {
27414 start: 0_u16,
27415 end: 0_u16,
27416 target_system: 0_u8,
27417 target_component: 0_u8,
27418 };
27419 #[cfg(feature = "arbitrary")]
27420 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27421 use arbitrary::{Arbitrary, Unstructured};
27422 let mut buf = [0u8; 1024];
27423 rng.fill_bytes(&mut buf);
27424 let mut unstructured = Unstructured::new(&buf);
27425 Self::arbitrary(&mut unstructured).unwrap_or_default()
27426 }
27427}
27428impl Default for LOG_REQUEST_LIST_DATA {
27429 fn default() -> Self {
27430 Self::DEFAULT.clone()
27431 }
27432}
27433impl MessageData for LOG_REQUEST_LIST_DATA {
27434 type Message = MavMessage;
27435 const ID: u32 = 117u32;
27436 const NAME: &'static str = "LOG_REQUEST_LIST";
27437 const EXTRA_CRC: u8 = 128u8;
27438 const ENCODED_LEN: usize = 6usize;
27439 fn deser(
27440 _version: MavlinkVersion,
27441 __input: &[u8],
27442 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27443 let avail_len = __input.len();
27444 let mut payload_buf = [0; Self::ENCODED_LEN];
27445 let mut buf = if avail_len < Self::ENCODED_LEN {
27446 payload_buf[0..avail_len].copy_from_slice(__input);
27447 Bytes::new(&payload_buf)
27448 } else {
27449 Bytes::new(__input)
27450 };
27451 let mut __struct = Self::default();
27452 __struct.start = buf.get_u16_le();
27453 __struct.end = buf.get_u16_le();
27454 __struct.target_system = buf.get_u8();
27455 __struct.target_component = buf.get_u8();
27456 Ok(__struct)
27457 }
27458 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27459 let mut __tmp = BytesMut::new(bytes);
27460 #[allow(clippy::absurd_extreme_comparisons)]
27461 #[allow(unused_comparisons)]
27462 if __tmp.remaining() < Self::ENCODED_LEN {
27463 panic!(
27464 "buffer is too small (need {} bytes, but got {})",
27465 Self::ENCODED_LEN,
27466 __tmp.remaining(),
27467 )
27468 }
27469 __tmp.put_u16_le(self.start);
27470 __tmp.put_u16_le(self.end);
27471 __tmp.put_u8(self.target_system);
27472 __tmp.put_u8(self.target_component);
27473 if matches!(version, MavlinkVersion::V2) {
27474 let len = __tmp.len();
27475 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27476 } else {
27477 __tmp.len()
27478 }
27479 }
27480}
27481#[doc = "id: 234"]
27482#[doc = "Message appropriate for high latency connections like Iridium."]
27483#[derive(Debug, Clone, PartialEq)]
27484#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27485#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27486pub struct HIGH_LATENCY_DATA {
27487 #[doc = "A bitfield for use for autopilot-specific flags."]
27488 pub custom_mode: u32,
27489 #[doc = "Latitude"]
27490 pub latitude: i32,
27491 #[doc = "Longitude"]
27492 pub longitude: i32,
27493 #[doc = "roll"]
27494 pub roll: i16,
27495 #[doc = "pitch"]
27496 pub pitch: i16,
27497 #[doc = "heading"]
27498 pub heading: u16,
27499 #[doc = "heading setpoint"]
27500 pub heading_sp: i16,
27501 #[doc = "Altitude above mean sea level"]
27502 pub altitude_amsl: i16,
27503 #[doc = "Altitude setpoint relative to the home position"]
27504 pub altitude_sp: i16,
27505 #[doc = "distance to target"]
27506 pub wp_distance: u16,
27507 #[doc = "Bitmap of enabled system modes."]
27508 pub base_mode: MavModeFlag,
27509 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
27510 pub landed_state: MavLandedState,
27511 #[doc = "throttle (percentage)"]
27512 pub throttle: i8,
27513 #[doc = "airspeed"]
27514 pub airspeed: u8,
27515 #[doc = "airspeed setpoint"]
27516 pub airspeed_sp: u8,
27517 #[doc = "groundspeed"]
27518 pub groundspeed: u8,
27519 #[doc = "climb rate"]
27520 pub climb_rate: i8,
27521 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
27522 pub gps_nsat: u8,
27523 #[doc = "GPS Fix type."]
27524 pub gps_fix_type: GpsFixType,
27525 #[doc = "Remaining battery (percentage)"]
27526 pub battery_remaining: u8,
27527 #[doc = "Autopilot temperature (degrees C)"]
27528 pub temperature: i8,
27529 #[doc = "Air temperature (degrees C) from airspeed sensor"]
27530 pub temperature_air: i8,
27531 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
27532 pub failsafe: u8,
27533 #[doc = "current waypoint number"]
27534 pub wp_num: u8,
27535}
27536impl HIGH_LATENCY_DATA {
27537 pub const ENCODED_LEN: usize = 40usize;
27538 pub const DEFAULT: Self = Self {
27539 custom_mode: 0_u32,
27540 latitude: 0_i32,
27541 longitude: 0_i32,
27542 roll: 0_i16,
27543 pitch: 0_i16,
27544 heading: 0_u16,
27545 heading_sp: 0_i16,
27546 altitude_amsl: 0_i16,
27547 altitude_sp: 0_i16,
27548 wp_distance: 0_u16,
27549 base_mode: MavModeFlag::DEFAULT,
27550 landed_state: MavLandedState::DEFAULT,
27551 throttle: 0_i8,
27552 airspeed: 0_u8,
27553 airspeed_sp: 0_u8,
27554 groundspeed: 0_u8,
27555 climb_rate: 0_i8,
27556 gps_nsat: 0_u8,
27557 gps_fix_type: GpsFixType::DEFAULT,
27558 battery_remaining: 0_u8,
27559 temperature: 0_i8,
27560 temperature_air: 0_i8,
27561 failsafe: 0_u8,
27562 wp_num: 0_u8,
27563 };
27564 #[cfg(feature = "arbitrary")]
27565 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27566 use arbitrary::{Arbitrary, Unstructured};
27567 let mut buf = [0u8; 1024];
27568 rng.fill_bytes(&mut buf);
27569 let mut unstructured = Unstructured::new(&buf);
27570 Self::arbitrary(&mut unstructured).unwrap_or_default()
27571 }
27572}
27573impl Default for HIGH_LATENCY_DATA {
27574 fn default() -> Self {
27575 Self::DEFAULT.clone()
27576 }
27577}
27578impl MessageData for HIGH_LATENCY_DATA {
27579 type Message = MavMessage;
27580 const ID: u32 = 234u32;
27581 const NAME: &'static str = "HIGH_LATENCY";
27582 const EXTRA_CRC: u8 = 150u8;
27583 const ENCODED_LEN: usize = 40usize;
27584 fn deser(
27585 _version: MavlinkVersion,
27586 __input: &[u8],
27587 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27588 let avail_len = __input.len();
27589 let mut payload_buf = [0; Self::ENCODED_LEN];
27590 let mut buf = if avail_len < Self::ENCODED_LEN {
27591 payload_buf[0..avail_len].copy_from_slice(__input);
27592 Bytes::new(&payload_buf)
27593 } else {
27594 Bytes::new(__input)
27595 };
27596 let mut __struct = Self::default();
27597 __struct.custom_mode = buf.get_u32_le();
27598 __struct.latitude = buf.get_i32_le();
27599 __struct.longitude = buf.get_i32_le();
27600 __struct.roll = buf.get_i16_le();
27601 __struct.pitch = buf.get_i16_le();
27602 __struct.heading = buf.get_u16_le();
27603 __struct.heading_sp = buf.get_i16_le();
27604 __struct.altitude_amsl = buf.get_i16_le();
27605 __struct.altitude_sp = buf.get_i16_le();
27606 __struct.wp_distance = buf.get_u16_le();
27607 let tmp = buf.get_u8();
27608 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
27609 ::mavlink_core::error::ParserError::InvalidFlag {
27610 flag_type: "MavModeFlag",
27611 value: tmp as u32,
27612 },
27613 )?;
27614 let tmp = buf.get_u8();
27615 __struct.landed_state =
27616 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27617 enum_type: "MavLandedState",
27618 value: tmp as u32,
27619 })?;
27620 __struct.throttle = buf.get_i8();
27621 __struct.airspeed = buf.get_u8();
27622 __struct.airspeed_sp = buf.get_u8();
27623 __struct.groundspeed = buf.get_u8();
27624 __struct.climb_rate = buf.get_i8();
27625 __struct.gps_nsat = buf.get_u8();
27626 let tmp = buf.get_u8();
27627 __struct.gps_fix_type =
27628 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27629 enum_type: "GpsFixType",
27630 value: tmp as u32,
27631 })?;
27632 __struct.battery_remaining = buf.get_u8();
27633 __struct.temperature = buf.get_i8();
27634 __struct.temperature_air = buf.get_i8();
27635 __struct.failsafe = buf.get_u8();
27636 __struct.wp_num = buf.get_u8();
27637 Ok(__struct)
27638 }
27639 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27640 let mut __tmp = BytesMut::new(bytes);
27641 #[allow(clippy::absurd_extreme_comparisons)]
27642 #[allow(unused_comparisons)]
27643 if __tmp.remaining() < Self::ENCODED_LEN {
27644 panic!(
27645 "buffer is too small (need {} bytes, but got {})",
27646 Self::ENCODED_LEN,
27647 __tmp.remaining(),
27648 )
27649 }
27650 __tmp.put_u32_le(self.custom_mode);
27651 __tmp.put_i32_le(self.latitude);
27652 __tmp.put_i32_le(self.longitude);
27653 __tmp.put_i16_le(self.roll);
27654 __tmp.put_i16_le(self.pitch);
27655 __tmp.put_u16_le(self.heading);
27656 __tmp.put_i16_le(self.heading_sp);
27657 __tmp.put_i16_le(self.altitude_amsl);
27658 __tmp.put_i16_le(self.altitude_sp);
27659 __tmp.put_u16_le(self.wp_distance);
27660 __tmp.put_u8(self.base_mode.bits());
27661 __tmp.put_u8(self.landed_state as u8);
27662 __tmp.put_i8(self.throttle);
27663 __tmp.put_u8(self.airspeed);
27664 __tmp.put_u8(self.airspeed_sp);
27665 __tmp.put_u8(self.groundspeed);
27666 __tmp.put_i8(self.climb_rate);
27667 __tmp.put_u8(self.gps_nsat);
27668 __tmp.put_u8(self.gps_fix_type as u8);
27669 __tmp.put_u8(self.battery_remaining);
27670 __tmp.put_i8(self.temperature);
27671 __tmp.put_i8(self.temperature_air);
27672 __tmp.put_u8(self.failsafe);
27673 __tmp.put_u8(self.wp_num);
27674 if matches!(version, MavlinkVersion::V2) {
27675 let len = __tmp.len();
27676 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27677 } else {
27678 __tmp.len()
27679 }
27680 }
27681}
27682#[doc = "id: 40"]
27683#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
27684#[derive(Debug, Clone, PartialEq)]
27685#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27686#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27687pub struct MISSION_REQUEST_DATA {
27688 #[doc = "Sequence"]
27689 pub seq: u16,
27690 #[doc = "System ID"]
27691 pub target_system: u8,
27692 #[doc = "Component ID"]
27693 pub target_component: u8,
27694 #[doc = "Mission type."]
27695 #[cfg_attr(feature = "serde", serde(default))]
27696 pub mission_type: MavMissionType,
27697}
27698impl MISSION_REQUEST_DATA {
27699 pub const ENCODED_LEN: usize = 5usize;
27700 pub const DEFAULT: Self = Self {
27701 seq: 0_u16,
27702 target_system: 0_u8,
27703 target_component: 0_u8,
27704 mission_type: MavMissionType::DEFAULT,
27705 };
27706 #[cfg(feature = "arbitrary")]
27707 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27708 use arbitrary::{Arbitrary, Unstructured};
27709 let mut buf = [0u8; 1024];
27710 rng.fill_bytes(&mut buf);
27711 let mut unstructured = Unstructured::new(&buf);
27712 Self::arbitrary(&mut unstructured).unwrap_or_default()
27713 }
27714}
27715impl Default for MISSION_REQUEST_DATA {
27716 fn default() -> Self {
27717 Self::DEFAULT.clone()
27718 }
27719}
27720impl MessageData for MISSION_REQUEST_DATA {
27721 type Message = MavMessage;
27722 const ID: u32 = 40u32;
27723 const NAME: &'static str = "MISSION_REQUEST";
27724 const EXTRA_CRC: u8 = 230u8;
27725 const ENCODED_LEN: usize = 5usize;
27726 fn deser(
27727 _version: MavlinkVersion,
27728 __input: &[u8],
27729 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27730 let avail_len = __input.len();
27731 let mut payload_buf = [0; Self::ENCODED_LEN];
27732 let mut buf = if avail_len < Self::ENCODED_LEN {
27733 payload_buf[0..avail_len].copy_from_slice(__input);
27734 Bytes::new(&payload_buf)
27735 } else {
27736 Bytes::new(__input)
27737 };
27738 let mut __struct = Self::default();
27739 __struct.seq = buf.get_u16_le();
27740 __struct.target_system = buf.get_u8();
27741 __struct.target_component = buf.get_u8();
27742 let tmp = buf.get_u8();
27743 __struct.mission_type =
27744 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27745 enum_type: "MavMissionType",
27746 value: tmp as u32,
27747 })?;
27748 Ok(__struct)
27749 }
27750 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27751 let mut __tmp = BytesMut::new(bytes);
27752 #[allow(clippy::absurd_extreme_comparisons)]
27753 #[allow(unused_comparisons)]
27754 if __tmp.remaining() < Self::ENCODED_LEN {
27755 panic!(
27756 "buffer is too small (need {} bytes, but got {})",
27757 Self::ENCODED_LEN,
27758 __tmp.remaining(),
27759 )
27760 }
27761 __tmp.put_u16_le(self.seq);
27762 __tmp.put_u8(self.target_system);
27763 __tmp.put_u8(self.target_component);
27764 __tmp.put_u8(self.mission_type as u8);
27765 if matches!(version, MavlinkVersion::V2) {
27766 let len = __tmp.len();
27767 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27768 } else {
27769 __tmp.len()
27770 }
27771 }
27772}
27773#[doc = "id: 121"]
27774#[doc = "Erase all logs."]
27775#[derive(Debug, Clone, PartialEq)]
27776#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27777#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27778pub struct LOG_ERASE_DATA {
27779 #[doc = "System ID"]
27780 pub target_system: u8,
27781 #[doc = "Component ID"]
27782 pub target_component: u8,
27783}
27784impl LOG_ERASE_DATA {
27785 pub const ENCODED_LEN: usize = 2usize;
27786 pub const DEFAULT: Self = Self {
27787 target_system: 0_u8,
27788 target_component: 0_u8,
27789 };
27790 #[cfg(feature = "arbitrary")]
27791 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27792 use arbitrary::{Arbitrary, Unstructured};
27793 let mut buf = [0u8; 1024];
27794 rng.fill_bytes(&mut buf);
27795 let mut unstructured = Unstructured::new(&buf);
27796 Self::arbitrary(&mut unstructured).unwrap_or_default()
27797 }
27798}
27799impl Default for LOG_ERASE_DATA {
27800 fn default() -> Self {
27801 Self::DEFAULT.clone()
27802 }
27803}
27804impl MessageData for LOG_ERASE_DATA {
27805 type Message = MavMessage;
27806 const ID: u32 = 121u32;
27807 const NAME: &'static str = "LOG_ERASE";
27808 const EXTRA_CRC: u8 = 237u8;
27809 const ENCODED_LEN: usize = 2usize;
27810 fn deser(
27811 _version: MavlinkVersion,
27812 __input: &[u8],
27813 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27814 let avail_len = __input.len();
27815 let mut payload_buf = [0; Self::ENCODED_LEN];
27816 let mut buf = if avail_len < Self::ENCODED_LEN {
27817 payload_buf[0..avail_len].copy_from_slice(__input);
27818 Bytes::new(&payload_buf)
27819 } else {
27820 Bytes::new(__input)
27821 };
27822 let mut __struct = Self::default();
27823 __struct.target_system = buf.get_u8();
27824 __struct.target_component = buf.get_u8();
27825 Ok(__struct)
27826 }
27827 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27828 let mut __tmp = BytesMut::new(bytes);
27829 #[allow(clippy::absurd_extreme_comparisons)]
27830 #[allow(unused_comparisons)]
27831 if __tmp.remaining() < Self::ENCODED_LEN {
27832 panic!(
27833 "buffer is too small (need {} bytes, but got {})",
27834 Self::ENCODED_LEN,
27835 __tmp.remaining(),
27836 )
27837 }
27838 __tmp.put_u8(self.target_system);
27839 __tmp.put_u8(self.target_component);
27840 if matches!(version, MavlinkVersion::V2) {
27841 let len = __tmp.len();
27842 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27843 } else {
27844 __tmp.len()
27845 }
27846 }
27847}
27848#[doc = "id: 385"]
27849#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
27850#[derive(Debug, Clone, PartialEq)]
27851#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27852#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27853pub struct TUNNEL_DATA {
27854 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
27855 pub payload_type: MavTunnelPayloadType,
27856 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
27857 pub target_system: u8,
27858 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
27859 pub target_component: u8,
27860 #[doc = "Length of the data transported in payload"]
27861 pub payload_length: u8,
27862 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
27863 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27864 pub payload: [u8; 128],
27865}
27866impl TUNNEL_DATA {
27867 pub const ENCODED_LEN: usize = 133usize;
27868 pub const DEFAULT: Self = Self {
27869 payload_type: MavTunnelPayloadType::DEFAULT,
27870 target_system: 0_u8,
27871 target_component: 0_u8,
27872 payload_length: 0_u8,
27873 payload: [0_u8; 128usize],
27874 };
27875 #[cfg(feature = "arbitrary")]
27876 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27877 use arbitrary::{Arbitrary, Unstructured};
27878 let mut buf = [0u8; 1024];
27879 rng.fill_bytes(&mut buf);
27880 let mut unstructured = Unstructured::new(&buf);
27881 Self::arbitrary(&mut unstructured).unwrap_or_default()
27882 }
27883}
27884impl Default for TUNNEL_DATA {
27885 fn default() -> Self {
27886 Self::DEFAULT.clone()
27887 }
27888}
27889impl MessageData for TUNNEL_DATA {
27890 type Message = MavMessage;
27891 const ID: u32 = 385u32;
27892 const NAME: &'static str = "TUNNEL";
27893 const EXTRA_CRC: u8 = 147u8;
27894 const ENCODED_LEN: usize = 133usize;
27895 fn deser(
27896 _version: MavlinkVersion,
27897 __input: &[u8],
27898 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27899 let avail_len = __input.len();
27900 let mut payload_buf = [0; Self::ENCODED_LEN];
27901 let mut buf = if avail_len < Self::ENCODED_LEN {
27902 payload_buf[0..avail_len].copy_from_slice(__input);
27903 Bytes::new(&payload_buf)
27904 } else {
27905 Bytes::new(__input)
27906 };
27907 let mut __struct = Self::default();
27908 let tmp = buf.get_u16_le();
27909 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
27910 ::mavlink_core::error::ParserError::InvalidEnum {
27911 enum_type: "MavTunnelPayloadType",
27912 value: tmp as u32,
27913 },
27914 )?;
27915 __struct.target_system = buf.get_u8();
27916 __struct.target_component = buf.get_u8();
27917 __struct.payload_length = buf.get_u8();
27918 for v in &mut __struct.payload {
27919 let val = buf.get_u8();
27920 *v = val;
27921 }
27922 Ok(__struct)
27923 }
27924 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27925 let mut __tmp = BytesMut::new(bytes);
27926 #[allow(clippy::absurd_extreme_comparisons)]
27927 #[allow(unused_comparisons)]
27928 if __tmp.remaining() < Self::ENCODED_LEN {
27929 panic!(
27930 "buffer is too small (need {} bytes, but got {})",
27931 Self::ENCODED_LEN,
27932 __tmp.remaining(),
27933 )
27934 }
27935 __tmp.put_u16_le(self.payload_type as u16);
27936 __tmp.put_u8(self.target_system);
27937 __tmp.put_u8(self.target_component);
27938 __tmp.put_u8(self.payload_length);
27939 for val in &self.payload {
27940 __tmp.put_u8(*val);
27941 }
27942 if matches!(version, MavlinkVersion::V2) {
27943 let len = __tmp.len();
27944 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27945 } else {
27946 __tmp.len()
27947 }
27948 }
27949}
27950#[doc = "id: 147"]
27951#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
27952#[derive(Debug, Clone, PartialEq)]
27953#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27954#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27955pub struct BATTERY_STATUS_DATA {
27956 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
27957 pub current_consumed: i32,
27958 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
27959 pub energy_consumed: i32,
27960 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
27961 pub temperature: i16,
27962 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
27963 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27964 pub voltages: [u16; 10],
27965 #[doc = "Battery current, -1: autopilot does not measure the current"]
27966 pub current_battery: i16,
27967 #[doc = "Battery ID"]
27968 pub id: u8,
27969 #[doc = "Function of the battery"]
27970 pub battery_function: MavBatteryFunction,
27971 #[doc = "Type (chemistry) of the battery"]
27972 pub mavtype: MavBatteryType,
27973 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
27974 pub battery_remaining: i8,
27975 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
27976 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27977 pub time_remaining: i32,
27978 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
27979 #[cfg_attr(feature = "serde", serde(default))]
27980 pub charge_state: MavBatteryChargeState,
27981 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
27982 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27983 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27984 pub voltages_ext: [u16; 4],
27985 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
27986 #[cfg_attr(feature = "serde", serde(default))]
27987 pub mode: MavBatteryMode,
27988 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
27989 #[cfg_attr(feature = "serde", serde(default))]
27990 pub fault_bitmask: MavBatteryFault,
27991}
27992impl BATTERY_STATUS_DATA {
27993 pub const ENCODED_LEN: usize = 54usize;
27994 pub const DEFAULT: Self = Self {
27995 current_consumed: 0_i32,
27996 energy_consumed: 0_i32,
27997 temperature: 0_i16,
27998 voltages: [0_u16; 10usize],
27999 current_battery: 0_i16,
28000 id: 0_u8,
28001 battery_function: MavBatteryFunction::DEFAULT,
28002 mavtype: MavBatteryType::DEFAULT,
28003 battery_remaining: 0_i8,
28004 time_remaining: 0_i32,
28005 charge_state: MavBatteryChargeState::DEFAULT,
28006 voltages_ext: [0_u16; 4usize],
28007 mode: MavBatteryMode::DEFAULT,
28008 fault_bitmask: MavBatteryFault::DEFAULT,
28009 };
28010 #[cfg(feature = "arbitrary")]
28011 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28012 use arbitrary::{Arbitrary, Unstructured};
28013 let mut buf = [0u8; 1024];
28014 rng.fill_bytes(&mut buf);
28015 let mut unstructured = Unstructured::new(&buf);
28016 Self::arbitrary(&mut unstructured).unwrap_or_default()
28017 }
28018}
28019impl Default for BATTERY_STATUS_DATA {
28020 fn default() -> Self {
28021 Self::DEFAULT.clone()
28022 }
28023}
28024impl MessageData for BATTERY_STATUS_DATA {
28025 type Message = MavMessage;
28026 const ID: u32 = 147u32;
28027 const NAME: &'static str = "BATTERY_STATUS";
28028 const EXTRA_CRC: u8 = 154u8;
28029 const ENCODED_LEN: usize = 54usize;
28030 fn deser(
28031 _version: MavlinkVersion,
28032 __input: &[u8],
28033 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28034 let avail_len = __input.len();
28035 let mut payload_buf = [0; Self::ENCODED_LEN];
28036 let mut buf = if avail_len < Self::ENCODED_LEN {
28037 payload_buf[0..avail_len].copy_from_slice(__input);
28038 Bytes::new(&payload_buf)
28039 } else {
28040 Bytes::new(__input)
28041 };
28042 let mut __struct = Self::default();
28043 __struct.current_consumed = buf.get_i32_le();
28044 __struct.energy_consumed = buf.get_i32_le();
28045 __struct.temperature = buf.get_i16_le();
28046 for v in &mut __struct.voltages {
28047 let val = buf.get_u16_le();
28048 *v = val;
28049 }
28050 __struct.current_battery = buf.get_i16_le();
28051 __struct.id = buf.get_u8();
28052 let tmp = buf.get_u8();
28053 __struct.battery_function =
28054 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28055 enum_type: "MavBatteryFunction",
28056 value: tmp as u32,
28057 })?;
28058 let tmp = buf.get_u8();
28059 __struct.mavtype =
28060 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28061 enum_type: "MavBatteryType",
28062 value: tmp as u32,
28063 })?;
28064 __struct.battery_remaining = buf.get_i8();
28065 __struct.time_remaining = buf.get_i32_le();
28066 let tmp = buf.get_u8();
28067 __struct.charge_state =
28068 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28069 enum_type: "MavBatteryChargeState",
28070 value: tmp as u32,
28071 })?;
28072 for v in &mut __struct.voltages_ext {
28073 let val = buf.get_u16_le();
28074 *v = val;
28075 }
28076 let tmp = buf.get_u8();
28077 __struct.mode =
28078 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28079 enum_type: "MavBatteryMode",
28080 value: tmp as u32,
28081 })?;
28082 let tmp = buf.get_u32_le();
28083 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
28084 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28085 flag_type: "MavBatteryFault",
28086 value: tmp as u32,
28087 })?;
28088 Ok(__struct)
28089 }
28090 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28091 let mut __tmp = BytesMut::new(bytes);
28092 #[allow(clippy::absurd_extreme_comparisons)]
28093 #[allow(unused_comparisons)]
28094 if __tmp.remaining() < Self::ENCODED_LEN {
28095 panic!(
28096 "buffer is too small (need {} bytes, but got {})",
28097 Self::ENCODED_LEN,
28098 __tmp.remaining(),
28099 )
28100 }
28101 __tmp.put_i32_le(self.current_consumed);
28102 __tmp.put_i32_le(self.energy_consumed);
28103 __tmp.put_i16_le(self.temperature);
28104 for val in &self.voltages {
28105 __tmp.put_u16_le(*val);
28106 }
28107 __tmp.put_i16_le(self.current_battery);
28108 __tmp.put_u8(self.id);
28109 __tmp.put_u8(self.battery_function as u8);
28110 __tmp.put_u8(self.mavtype as u8);
28111 __tmp.put_i8(self.battery_remaining);
28112 __tmp.put_i32_le(self.time_remaining);
28113 __tmp.put_u8(self.charge_state as u8);
28114 for val in &self.voltages_ext {
28115 __tmp.put_u16_le(*val);
28116 }
28117 __tmp.put_u8(self.mode as u8);
28118 __tmp.put_u32_le(self.fault_bitmask.bits());
28119 if matches!(version, MavlinkVersion::V2) {
28120 let len = __tmp.len();
28121 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28122 } else {
28123 __tmp.len()
28124 }
28125 }
28126}
28127#[doc = "id: 1"]
28128#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
28129#[derive(Debug, Clone, PartialEq)]
28130#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28131#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28132pub struct SYS_STATUS_DATA {
28133 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28134 pub onboard_control_sensors_present: MavSysStatusSensor,
28135 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28136 pub onboard_control_sensors_enabled: MavSysStatusSensor,
28137 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28138 pub onboard_control_sensors_health: MavSysStatusSensor,
28139 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
28140 pub load: u16,
28141 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
28142 pub voltage_battery: u16,
28143 #[doc = "Battery current, -1: Current not sent by autopilot"]
28144 pub current_battery: i16,
28145 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28146 pub drop_rate_comm: u16,
28147 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28148 pub errors_comm: u16,
28149 #[doc = "Autopilot-specific errors"]
28150 pub errors_count1: u16,
28151 #[doc = "Autopilot-specific errors"]
28152 pub errors_count2: u16,
28153 #[doc = "Autopilot-specific errors"]
28154 pub errors_count3: u16,
28155 #[doc = "Autopilot-specific errors"]
28156 pub errors_count4: u16,
28157 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
28158 pub battery_remaining: i8,
28159 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28160 #[cfg_attr(feature = "serde", serde(default))]
28161 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
28162 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28163 #[cfg_attr(feature = "serde", serde(default))]
28164 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
28165 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28166 #[cfg_attr(feature = "serde", serde(default))]
28167 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
28168}
28169impl SYS_STATUS_DATA {
28170 pub const ENCODED_LEN: usize = 43usize;
28171 pub const DEFAULT: Self = Self {
28172 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
28173 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
28174 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
28175 load: 0_u16,
28176 voltage_battery: 0_u16,
28177 current_battery: 0_i16,
28178 drop_rate_comm: 0_u16,
28179 errors_comm: 0_u16,
28180 errors_count1: 0_u16,
28181 errors_count2: 0_u16,
28182 errors_count3: 0_u16,
28183 errors_count4: 0_u16,
28184 battery_remaining: 0_i8,
28185 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
28186 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
28187 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
28188 };
28189 #[cfg(feature = "arbitrary")]
28190 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28191 use arbitrary::{Arbitrary, Unstructured};
28192 let mut buf = [0u8; 1024];
28193 rng.fill_bytes(&mut buf);
28194 let mut unstructured = Unstructured::new(&buf);
28195 Self::arbitrary(&mut unstructured).unwrap_or_default()
28196 }
28197}
28198impl Default for SYS_STATUS_DATA {
28199 fn default() -> Self {
28200 Self::DEFAULT.clone()
28201 }
28202}
28203impl MessageData for SYS_STATUS_DATA {
28204 type Message = MavMessage;
28205 const ID: u32 = 1u32;
28206 const NAME: &'static str = "SYS_STATUS";
28207 const EXTRA_CRC: u8 = 124u8;
28208 const ENCODED_LEN: usize = 43usize;
28209 fn deser(
28210 _version: MavlinkVersion,
28211 __input: &[u8],
28212 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28213 let avail_len = __input.len();
28214 let mut payload_buf = [0; Self::ENCODED_LEN];
28215 let mut buf = if avail_len < Self::ENCODED_LEN {
28216 payload_buf[0..avail_len].copy_from_slice(__input);
28217 Bytes::new(&payload_buf)
28218 } else {
28219 Bytes::new(__input)
28220 };
28221 let mut __struct = Self::default();
28222 let tmp = buf.get_u32_le();
28223 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
28224 tmp & MavSysStatusSensor::all().bits(),
28225 )
28226 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28227 flag_type: "MavSysStatusSensor",
28228 value: tmp as u32,
28229 })?;
28230 let tmp = buf.get_u32_le();
28231 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
28232 tmp & MavSysStatusSensor::all().bits(),
28233 )
28234 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28235 flag_type: "MavSysStatusSensor",
28236 value: tmp as u32,
28237 })?;
28238 let tmp = buf.get_u32_le();
28239 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
28240 tmp & MavSysStatusSensor::all().bits(),
28241 )
28242 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28243 flag_type: "MavSysStatusSensor",
28244 value: tmp as u32,
28245 })?;
28246 __struct.load = buf.get_u16_le();
28247 __struct.voltage_battery = buf.get_u16_le();
28248 __struct.current_battery = buf.get_i16_le();
28249 __struct.drop_rate_comm = buf.get_u16_le();
28250 __struct.errors_comm = buf.get_u16_le();
28251 __struct.errors_count1 = buf.get_u16_le();
28252 __struct.errors_count2 = buf.get_u16_le();
28253 __struct.errors_count3 = buf.get_u16_le();
28254 __struct.errors_count4 = buf.get_u16_le();
28255 __struct.battery_remaining = buf.get_i8();
28256 let tmp = buf.get_u32_le();
28257 __struct.onboard_control_sensors_present_extended =
28258 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28259 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28260 flag_type: "MavSysStatusSensorExtended",
28261 value: tmp as u32,
28262 })?;
28263 let tmp = buf.get_u32_le();
28264 __struct.onboard_control_sensors_enabled_extended =
28265 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28266 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28267 flag_type: "MavSysStatusSensorExtended",
28268 value: tmp as u32,
28269 })?;
28270 let tmp = buf.get_u32_le();
28271 __struct.onboard_control_sensors_health_extended =
28272 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28273 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28274 flag_type: "MavSysStatusSensorExtended",
28275 value: tmp as u32,
28276 })?;
28277 Ok(__struct)
28278 }
28279 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28280 let mut __tmp = BytesMut::new(bytes);
28281 #[allow(clippy::absurd_extreme_comparisons)]
28282 #[allow(unused_comparisons)]
28283 if __tmp.remaining() < Self::ENCODED_LEN {
28284 panic!(
28285 "buffer is too small (need {} bytes, but got {})",
28286 Self::ENCODED_LEN,
28287 __tmp.remaining(),
28288 )
28289 }
28290 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
28291 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
28292 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
28293 __tmp.put_u16_le(self.load);
28294 __tmp.put_u16_le(self.voltage_battery);
28295 __tmp.put_i16_le(self.current_battery);
28296 __tmp.put_u16_le(self.drop_rate_comm);
28297 __tmp.put_u16_le(self.errors_comm);
28298 __tmp.put_u16_le(self.errors_count1);
28299 __tmp.put_u16_le(self.errors_count2);
28300 __tmp.put_u16_le(self.errors_count3);
28301 __tmp.put_u16_le(self.errors_count4);
28302 __tmp.put_i8(self.battery_remaining);
28303 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
28304 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
28305 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
28306 if matches!(version, MavlinkVersion::V2) {
28307 let len = __tmp.len();
28308 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28309 } else {
28310 __tmp.len()
28311 }
28312 }
28313}
28314#[doc = "id: 142"]
28315#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
28316#[derive(Debug, Clone, PartialEq)]
28317#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28318#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28319pub struct RESOURCE_REQUEST_DATA {
28320 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
28321 pub request_id: u8,
28322 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
28323 pub uri_type: u8,
28324 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
28325 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28326 pub uri: [u8; 120],
28327 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
28328 pub transfer_type: u8,
28329 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
28330 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28331 pub storage: [u8; 120],
28332}
28333impl RESOURCE_REQUEST_DATA {
28334 pub const ENCODED_LEN: usize = 243usize;
28335 pub const DEFAULT: Self = Self {
28336 request_id: 0_u8,
28337 uri_type: 0_u8,
28338 uri: [0_u8; 120usize],
28339 transfer_type: 0_u8,
28340 storage: [0_u8; 120usize],
28341 };
28342 #[cfg(feature = "arbitrary")]
28343 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28344 use arbitrary::{Arbitrary, Unstructured};
28345 let mut buf = [0u8; 1024];
28346 rng.fill_bytes(&mut buf);
28347 let mut unstructured = Unstructured::new(&buf);
28348 Self::arbitrary(&mut unstructured).unwrap_or_default()
28349 }
28350}
28351impl Default for RESOURCE_REQUEST_DATA {
28352 fn default() -> Self {
28353 Self::DEFAULT.clone()
28354 }
28355}
28356impl MessageData for RESOURCE_REQUEST_DATA {
28357 type Message = MavMessage;
28358 const ID: u32 = 142u32;
28359 const NAME: &'static str = "RESOURCE_REQUEST";
28360 const EXTRA_CRC: u8 = 72u8;
28361 const ENCODED_LEN: usize = 243usize;
28362 fn deser(
28363 _version: MavlinkVersion,
28364 __input: &[u8],
28365 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28366 let avail_len = __input.len();
28367 let mut payload_buf = [0; Self::ENCODED_LEN];
28368 let mut buf = if avail_len < Self::ENCODED_LEN {
28369 payload_buf[0..avail_len].copy_from_slice(__input);
28370 Bytes::new(&payload_buf)
28371 } else {
28372 Bytes::new(__input)
28373 };
28374 let mut __struct = Self::default();
28375 __struct.request_id = buf.get_u8();
28376 __struct.uri_type = buf.get_u8();
28377 for v in &mut __struct.uri {
28378 let val = buf.get_u8();
28379 *v = val;
28380 }
28381 __struct.transfer_type = buf.get_u8();
28382 for v in &mut __struct.storage {
28383 let val = buf.get_u8();
28384 *v = val;
28385 }
28386 Ok(__struct)
28387 }
28388 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28389 let mut __tmp = BytesMut::new(bytes);
28390 #[allow(clippy::absurd_extreme_comparisons)]
28391 #[allow(unused_comparisons)]
28392 if __tmp.remaining() < Self::ENCODED_LEN {
28393 panic!(
28394 "buffer is too small (need {} bytes, but got {})",
28395 Self::ENCODED_LEN,
28396 __tmp.remaining(),
28397 )
28398 }
28399 __tmp.put_u8(self.request_id);
28400 __tmp.put_u8(self.uri_type);
28401 for val in &self.uri {
28402 __tmp.put_u8(*val);
28403 }
28404 __tmp.put_u8(self.transfer_type);
28405 for val in &self.storage {
28406 __tmp.put_u8(*val);
28407 }
28408 if matches!(version, MavlinkVersion::V2) {
28409 let len = __tmp.len();
28410 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28411 } else {
28412 __tmp.len()
28413 }
28414 }
28415}
28416#[doc = "id: 241"]
28417#[doc = "Vibration levels and accelerometer clipping."]
28418#[derive(Debug, Clone, PartialEq)]
28419#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28420#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28421pub struct VIBRATION_DATA {
28422 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28423 pub time_usec: u64,
28424 #[doc = "Vibration levels on X-axis"]
28425 pub vibration_x: f32,
28426 #[doc = "Vibration levels on Y-axis"]
28427 pub vibration_y: f32,
28428 #[doc = "Vibration levels on Z-axis"]
28429 pub vibration_z: f32,
28430 #[doc = "first accelerometer clipping count"]
28431 pub clipping_0: u32,
28432 #[doc = "second accelerometer clipping count"]
28433 pub clipping_1: u32,
28434 #[doc = "third accelerometer clipping count"]
28435 pub clipping_2: u32,
28436}
28437impl VIBRATION_DATA {
28438 pub const ENCODED_LEN: usize = 32usize;
28439 pub const DEFAULT: Self = Self {
28440 time_usec: 0_u64,
28441 vibration_x: 0.0_f32,
28442 vibration_y: 0.0_f32,
28443 vibration_z: 0.0_f32,
28444 clipping_0: 0_u32,
28445 clipping_1: 0_u32,
28446 clipping_2: 0_u32,
28447 };
28448 #[cfg(feature = "arbitrary")]
28449 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28450 use arbitrary::{Arbitrary, Unstructured};
28451 let mut buf = [0u8; 1024];
28452 rng.fill_bytes(&mut buf);
28453 let mut unstructured = Unstructured::new(&buf);
28454 Self::arbitrary(&mut unstructured).unwrap_or_default()
28455 }
28456}
28457impl Default for VIBRATION_DATA {
28458 fn default() -> Self {
28459 Self::DEFAULT.clone()
28460 }
28461}
28462impl MessageData for VIBRATION_DATA {
28463 type Message = MavMessage;
28464 const ID: u32 = 241u32;
28465 const NAME: &'static str = "VIBRATION";
28466 const EXTRA_CRC: u8 = 90u8;
28467 const ENCODED_LEN: usize = 32usize;
28468 fn deser(
28469 _version: MavlinkVersion,
28470 __input: &[u8],
28471 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28472 let avail_len = __input.len();
28473 let mut payload_buf = [0; Self::ENCODED_LEN];
28474 let mut buf = if avail_len < Self::ENCODED_LEN {
28475 payload_buf[0..avail_len].copy_from_slice(__input);
28476 Bytes::new(&payload_buf)
28477 } else {
28478 Bytes::new(__input)
28479 };
28480 let mut __struct = Self::default();
28481 __struct.time_usec = buf.get_u64_le();
28482 __struct.vibration_x = buf.get_f32_le();
28483 __struct.vibration_y = buf.get_f32_le();
28484 __struct.vibration_z = buf.get_f32_le();
28485 __struct.clipping_0 = buf.get_u32_le();
28486 __struct.clipping_1 = buf.get_u32_le();
28487 __struct.clipping_2 = buf.get_u32_le();
28488 Ok(__struct)
28489 }
28490 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28491 let mut __tmp = BytesMut::new(bytes);
28492 #[allow(clippy::absurd_extreme_comparisons)]
28493 #[allow(unused_comparisons)]
28494 if __tmp.remaining() < Self::ENCODED_LEN {
28495 panic!(
28496 "buffer is too small (need {} bytes, but got {})",
28497 Self::ENCODED_LEN,
28498 __tmp.remaining(),
28499 )
28500 }
28501 __tmp.put_u64_le(self.time_usec);
28502 __tmp.put_f32_le(self.vibration_x);
28503 __tmp.put_f32_le(self.vibration_y);
28504 __tmp.put_f32_le(self.vibration_z);
28505 __tmp.put_u32_le(self.clipping_0);
28506 __tmp.put_u32_le(self.clipping_1);
28507 __tmp.put_u32_le(self.clipping_2);
28508 if matches!(version, MavlinkVersion::V2) {
28509 let len = __tmp.len();
28510 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28511 } else {
28512 __tmp.len()
28513 }
28514 }
28515}
28516#[doc = "id: 350"]
28517#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
28518#[derive(Debug, Clone, PartialEq)]
28519#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28520#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28521pub struct DEBUG_FLOAT_ARRAY_DATA {
28522 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28523 pub time_usec: u64,
28524 #[doc = "Unique ID used to discriminate between arrays"]
28525 pub array_id: u16,
28526 #[doc = "Name, for human-friendly display in a Ground Control Station"]
28527 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28528 pub name: [u8; 10],
28529 #[doc = "data"]
28530 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28531 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28532 pub data: [f32; 58],
28533}
28534impl DEBUG_FLOAT_ARRAY_DATA {
28535 pub const ENCODED_LEN: usize = 252usize;
28536 pub const DEFAULT: Self = Self {
28537 time_usec: 0_u64,
28538 array_id: 0_u16,
28539 name: [0_u8; 10usize],
28540 data: [0.0_f32; 58usize],
28541 };
28542 #[cfg(feature = "arbitrary")]
28543 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28544 use arbitrary::{Arbitrary, Unstructured};
28545 let mut buf = [0u8; 1024];
28546 rng.fill_bytes(&mut buf);
28547 let mut unstructured = Unstructured::new(&buf);
28548 Self::arbitrary(&mut unstructured).unwrap_or_default()
28549 }
28550}
28551impl Default for DEBUG_FLOAT_ARRAY_DATA {
28552 fn default() -> Self {
28553 Self::DEFAULT.clone()
28554 }
28555}
28556impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
28557 type Message = MavMessage;
28558 const ID: u32 = 350u32;
28559 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
28560 const EXTRA_CRC: u8 = 232u8;
28561 const ENCODED_LEN: usize = 252usize;
28562 fn deser(
28563 _version: MavlinkVersion,
28564 __input: &[u8],
28565 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28566 let avail_len = __input.len();
28567 let mut payload_buf = [0; Self::ENCODED_LEN];
28568 let mut buf = if avail_len < Self::ENCODED_LEN {
28569 payload_buf[0..avail_len].copy_from_slice(__input);
28570 Bytes::new(&payload_buf)
28571 } else {
28572 Bytes::new(__input)
28573 };
28574 let mut __struct = Self::default();
28575 __struct.time_usec = buf.get_u64_le();
28576 __struct.array_id = buf.get_u16_le();
28577 for v in &mut __struct.name {
28578 let val = buf.get_u8();
28579 *v = val;
28580 }
28581 for v in &mut __struct.data {
28582 let val = buf.get_f32_le();
28583 *v = val;
28584 }
28585 Ok(__struct)
28586 }
28587 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28588 let mut __tmp = BytesMut::new(bytes);
28589 #[allow(clippy::absurd_extreme_comparisons)]
28590 #[allow(unused_comparisons)]
28591 if __tmp.remaining() < Self::ENCODED_LEN {
28592 panic!(
28593 "buffer is too small (need {} bytes, but got {})",
28594 Self::ENCODED_LEN,
28595 __tmp.remaining(),
28596 )
28597 }
28598 __tmp.put_u64_le(self.time_usec);
28599 __tmp.put_u16_le(self.array_id);
28600 for val in &self.name {
28601 __tmp.put_u8(*val);
28602 }
28603 for val in &self.data {
28604 __tmp.put_f32_le(*val);
28605 }
28606 if matches!(version, MavlinkVersion::V2) {
28607 let len = __tmp.len();
28608 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28609 } else {
28610 __tmp.len()
28611 }
28612 }
28613}
28614#[doc = "id: 8"]
28615#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
28616#[derive(Debug, Clone, PartialEq)]
28617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28618#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28619pub struct LINK_NODE_STATUS_DATA {
28620 #[doc = "Timestamp (time since system boot)."]
28621 pub timestamp: u64,
28622 #[doc = "Transmit rate"]
28623 pub tx_rate: u32,
28624 #[doc = "Receive rate"]
28625 pub rx_rate: u32,
28626 #[doc = "Messages sent"]
28627 pub messages_sent: u32,
28628 #[doc = "Messages received (estimated from counting seq)"]
28629 pub messages_received: u32,
28630 #[doc = "Messages lost (estimated from counting seq)"]
28631 pub messages_lost: u32,
28632 #[doc = "Number of bytes that could not be parsed correctly."]
28633 pub rx_parse_err: u16,
28634 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
28635 pub tx_overflows: u16,
28636 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
28637 pub rx_overflows: u16,
28638 #[doc = "Remaining free transmit buffer space"]
28639 pub tx_buf: u8,
28640 #[doc = "Remaining free receive buffer space"]
28641 pub rx_buf: u8,
28642}
28643impl LINK_NODE_STATUS_DATA {
28644 pub const ENCODED_LEN: usize = 36usize;
28645 pub const DEFAULT: Self = Self {
28646 timestamp: 0_u64,
28647 tx_rate: 0_u32,
28648 rx_rate: 0_u32,
28649 messages_sent: 0_u32,
28650 messages_received: 0_u32,
28651 messages_lost: 0_u32,
28652 rx_parse_err: 0_u16,
28653 tx_overflows: 0_u16,
28654 rx_overflows: 0_u16,
28655 tx_buf: 0_u8,
28656 rx_buf: 0_u8,
28657 };
28658 #[cfg(feature = "arbitrary")]
28659 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28660 use arbitrary::{Arbitrary, Unstructured};
28661 let mut buf = [0u8; 1024];
28662 rng.fill_bytes(&mut buf);
28663 let mut unstructured = Unstructured::new(&buf);
28664 Self::arbitrary(&mut unstructured).unwrap_or_default()
28665 }
28666}
28667impl Default for LINK_NODE_STATUS_DATA {
28668 fn default() -> Self {
28669 Self::DEFAULT.clone()
28670 }
28671}
28672impl MessageData for LINK_NODE_STATUS_DATA {
28673 type Message = MavMessage;
28674 const ID: u32 = 8u32;
28675 const NAME: &'static str = "LINK_NODE_STATUS";
28676 const EXTRA_CRC: u8 = 117u8;
28677 const ENCODED_LEN: usize = 36usize;
28678 fn deser(
28679 _version: MavlinkVersion,
28680 __input: &[u8],
28681 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28682 let avail_len = __input.len();
28683 let mut payload_buf = [0; Self::ENCODED_LEN];
28684 let mut buf = if avail_len < Self::ENCODED_LEN {
28685 payload_buf[0..avail_len].copy_from_slice(__input);
28686 Bytes::new(&payload_buf)
28687 } else {
28688 Bytes::new(__input)
28689 };
28690 let mut __struct = Self::default();
28691 __struct.timestamp = buf.get_u64_le();
28692 __struct.tx_rate = buf.get_u32_le();
28693 __struct.rx_rate = buf.get_u32_le();
28694 __struct.messages_sent = buf.get_u32_le();
28695 __struct.messages_received = buf.get_u32_le();
28696 __struct.messages_lost = buf.get_u32_le();
28697 __struct.rx_parse_err = buf.get_u16_le();
28698 __struct.tx_overflows = buf.get_u16_le();
28699 __struct.rx_overflows = buf.get_u16_le();
28700 __struct.tx_buf = buf.get_u8();
28701 __struct.rx_buf = buf.get_u8();
28702 Ok(__struct)
28703 }
28704 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28705 let mut __tmp = BytesMut::new(bytes);
28706 #[allow(clippy::absurd_extreme_comparisons)]
28707 #[allow(unused_comparisons)]
28708 if __tmp.remaining() < Self::ENCODED_LEN {
28709 panic!(
28710 "buffer is too small (need {} bytes, but got {})",
28711 Self::ENCODED_LEN,
28712 __tmp.remaining(),
28713 )
28714 }
28715 __tmp.put_u64_le(self.timestamp);
28716 __tmp.put_u32_le(self.tx_rate);
28717 __tmp.put_u32_le(self.rx_rate);
28718 __tmp.put_u32_le(self.messages_sent);
28719 __tmp.put_u32_le(self.messages_received);
28720 __tmp.put_u32_le(self.messages_lost);
28721 __tmp.put_u16_le(self.rx_parse_err);
28722 __tmp.put_u16_le(self.tx_overflows);
28723 __tmp.put_u16_le(self.rx_overflows);
28724 __tmp.put_u8(self.tx_buf);
28725 __tmp.put_u8(self.rx_buf);
28726 if matches!(version, MavlinkVersion::V2) {
28727 let len = __tmp.len();
28728 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28729 } else {
28730 __tmp.len()
28731 }
28732 }
28733}
28734#[doc = "id: 138"]
28735#[doc = "Motion capture attitude and position."]
28736#[derive(Debug, Clone, PartialEq)]
28737#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28738#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28739pub struct ATT_POS_MOCAP_DATA {
28740 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28741 pub time_usec: u64,
28742 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
28743 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28744 pub q: [f32; 4],
28745 #[doc = "X position (NED)"]
28746 pub x: f32,
28747 #[doc = "Y position (NED)"]
28748 pub y: f32,
28749 #[doc = "Z position (NED)"]
28750 pub z: f32,
28751 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
28752 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28753 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28754 pub covariance: [f32; 21],
28755}
28756impl ATT_POS_MOCAP_DATA {
28757 pub const ENCODED_LEN: usize = 120usize;
28758 pub const DEFAULT: Self = Self {
28759 time_usec: 0_u64,
28760 q: [0.0_f32; 4usize],
28761 x: 0.0_f32,
28762 y: 0.0_f32,
28763 z: 0.0_f32,
28764 covariance: [0.0_f32; 21usize],
28765 };
28766 #[cfg(feature = "arbitrary")]
28767 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28768 use arbitrary::{Arbitrary, Unstructured};
28769 let mut buf = [0u8; 1024];
28770 rng.fill_bytes(&mut buf);
28771 let mut unstructured = Unstructured::new(&buf);
28772 Self::arbitrary(&mut unstructured).unwrap_or_default()
28773 }
28774}
28775impl Default for ATT_POS_MOCAP_DATA {
28776 fn default() -> Self {
28777 Self::DEFAULT.clone()
28778 }
28779}
28780impl MessageData for ATT_POS_MOCAP_DATA {
28781 type Message = MavMessage;
28782 const ID: u32 = 138u32;
28783 const NAME: &'static str = "ATT_POS_MOCAP";
28784 const EXTRA_CRC: u8 = 109u8;
28785 const ENCODED_LEN: usize = 120usize;
28786 fn deser(
28787 _version: MavlinkVersion,
28788 __input: &[u8],
28789 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28790 let avail_len = __input.len();
28791 let mut payload_buf = [0; Self::ENCODED_LEN];
28792 let mut buf = if avail_len < Self::ENCODED_LEN {
28793 payload_buf[0..avail_len].copy_from_slice(__input);
28794 Bytes::new(&payload_buf)
28795 } else {
28796 Bytes::new(__input)
28797 };
28798 let mut __struct = Self::default();
28799 __struct.time_usec = buf.get_u64_le();
28800 for v in &mut __struct.q {
28801 let val = buf.get_f32_le();
28802 *v = val;
28803 }
28804 __struct.x = buf.get_f32_le();
28805 __struct.y = buf.get_f32_le();
28806 __struct.z = buf.get_f32_le();
28807 for v in &mut __struct.covariance {
28808 let val = buf.get_f32_le();
28809 *v = val;
28810 }
28811 Ok(__struct)
28812 }
28813 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28814 let mut __tmp = BytesMut::new(bytes);
28815 #[allow(clippy::absurd_extreme_comparisons)]
28816 #[allow(unused_comparisons)]
28817 if __tmp.remaining() < Self::ENCODED_LEN {
28818 panic!(
28819 "buffer is too small (need {} bytes, but got {})",
28820 Self::ENCODED_LEN,
28821 __tmp.remaining(),
28822 )
28823 }
28824 __tmp.put_u64_le(self.time_usec);
28825 for val in &self.q {
28826 __tmp.put_f32_le(*val);
28827 }
28828 __tmp.put_f32_le(self.x);
28829 __tmp.put_f32_le(self.y);
28830 __tmp.put_f32_le(self.z);
28831 for val in &self.covariance {
28832 __tmp.put_f32_le(*val);
28833 }
28834 if matches!(version, MavlinkVersion::V2) {
28835 let len = __tmp.len();
28836 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28837 } else {
28838 __tmp.len()
28839 }
28840 }
28841}
28842#[doc = "id: 146"]
28843#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
28844#[derive(Debug, Clone, PartialEq)]
28845#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28846#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28847pub struct CONTROL_SYSTEM_STATE_DATA {
28848 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
28849 pub time_usec: u64,
28850 #[doc = "X acceleration in body frame"]
28851 pub x_acc: f32,
28852 #[doc = "Y acceleration in body frame"]
28853 pub y_acc: f32,
28854 #[doc = "Z acceleration in body frame"]
28855 pub z_acc: f32,
28856 #[doc = "X velocity in body frame"]
28857 pub x_vel: f32,
28858 #[doc = "Y velocity in body frame"]
28859 pub y_vel: f32,
28860 #[doc = "Z velocity in body frame"]
28861 pub z_vel: f32,
28862 #[doc = "X position in local frame"]
28863 pub x_pos: f32,
28864 #[doc = "Y position in local frame"]
28865 pub y_pos: f32,
28866 #[doc = "Z position in local frame"]
28867 pub z_pos: f32,
28868 #[doc = "Airspeed, set to -1 if unknown"]
28869 pub airspeed: f32,
28870 #[doc = "Variance of body velocity estimate"]
28871 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28872 pub vel_variance: [f32; 3],
28873 #[doc = "Variance in local position"]
28874 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28875 pub pos_variance: [f32; 3],
28876 #[doc = "The attitude, represented as Quaternion"]
28877 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28878 pub q: [f32; 4],
28879 #[doc = "Angular rate in roll axis"]
28880 pub roll_rate: f32,
28881 #[doc = "Angular rate in pitch axis"]
28882 pub pitch_rate: f32,
28883 #[doc = "Angular rate in yaw axis"]
28884 pub yaw_rate: f32,
28885}
28886impl CONTROL_SYSTEM_STATE_DATA {
28887 pub const ENCODED_LEN: usize = 100usize;
28888 pub const DEFAULT: Self = Self {
28889 time_usec: 0_u64,
28890 x_acc: 0.0_f32,
28891 y_acc: 0.0_f32,
28892 z_acc: 0.0_f32,
28893 x_vel: 0.0_f32,
28894 y_vel: 0.0_f32,
28895 z_vel: 0.0_f32,
28896 x_pos: 0.0_f32,
28897 y_pos: 0.0_f32,
28898 z_pos: 0.0_f32,
28899 airspeed: 0.0_f32,
28900 vel_variance: [0.0_f32; 3usize],
28901 pos_variance: [0.0_f32; 3usize],
28902 q: [0.0_f32; 4usize],
28903 roll_rate: 0.0_f32,
28904 pitch_rate: 0.0_f32,
28905 yaw_rate: 0.0_f32,
28906 };
28907 #[cfg(feature = "arbitrary")]
28908 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28909 use arbitrary::{Arbitrary, Unstructured};
28910 let mut buf = [0u8; 1024];
28911 rng.fill_bytes(&mut buf);
28912 let mut unstructured = Unstructured::new(&buf);
28913 Self::arbitrary(&mut unstructured).unwrap_or_default()
28914 }
28915}
28916impl Default for CONTROL_SYSTEM_STATE_DATA {
28917 fn default() -> Self {
28918 Self::DEFAULT.clone()
28919 }
28920}
28921impl MessageData for CONTROL_SYSTEM_STATE_DATA {
28922 type Message = MavMessage;
28923 const ID: u32 = 146u32;
28924 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
28925 const EXTRA_CRC: u8 = 103u8;
28926 const ENCODED_LEN: usize = 100usize;
28927 fn deser(
28928 _version: MavlinkVersion,
28929 __input: &[u8],
28930 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28931 let avail_len = __input.len();
28932 let mut payload_buf = [0; Self::ENCODED_LEN];
28933 let mut buf = if avail_len < Self::ENCODED_LEN {
28934 payload_buf[0..avail_len].copy_from_slice(__input);
28935 Bytes::new(&payload_buf)
28936 } else {
28937 Bytes::new(__input)
28938 };
28939 let mut __struct = Self::default();
28940 __struct.time_usec = buf.get_u64_le();
28941 __struct.x_acc = buf.get_f32_le();
28942 __struct.y_acc = buf.get_f32_le();
28943 __struct.z_acc = buf.get_f32_le();
28944 __struct.x_vel = buf.get_f32_le();
28945 __struct.y_vel = buf.get_f32_le();
28946 __struct.z_vel = buf.get_f32_le();
28947 __struct.x_pos = buf.get_f32_le();
28948 __struct.y_pos = buf.get_f32_le();
28949 __struct.z_pos = buf.get_f32_le();
28950 __struct.airspeed = buf.get_f32_le();
28951 for v in &mut __struct.vel_variance {
28952 let val = buf.get_f32_le();
28953 *v = val;
28954 }
28955 for v in &mut __struct.pos_variance {
28956 let val = buf.get_f32_le();
28957 *v = val;
28958 }
28959 for v in &mut __struct.q {
28960 let val = buf.get_f32_le();
28961 *v = val;
28962 }
28963 __struct.roll_rate = buf.get_f32_le();
28964 __struct.pitch_rate = buf.get_f32_le();
28965 __struct.yaw_rate = buf.get_f32_le();
28966 Ok(__struct)
28967 }
28968 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28969 let mut __tmp = BytesMut::new(bytes);
28970 #[allow(clippy::absurd_extreme_comparisons)]
28971 #[allow(unused_comparisons)]
28972 if __tmp.remaining() < Self::ENCODED_LEN {
28973 panic!(
28974 "buffer is too small (need {} bytes, but got {})",
28975 Self::ENCODED_LEN,
28976 __tmp.remaining(),
28977 )
28978 }
28979 __tmp.put_u64_le(self.time_usec);
28980 __tmp.put_f32_le(self.x_acc);
28981 __tmp.put_f32_le(self.y_acc);
28982 __tmp.put_f32_le(self.z_acc);
28983 __tmp.put_f32_le(self.x_vel);
28984 __tmp.put_f32_le(self.y_vel);
28985 __tmp.put_f32_le(self.z_vel);
28986 __tmp.put_f32_le(self.x_pos);
28987 __tmp.put_f32_le(self.y_pos);
28988 __tmp.put_f32_le(self.z_pos);
28989 __tmp.put_f32_le(self.airspeed);
28990 for val in &self.vel_variance {
28991 __tmp.put_f32_le(*val);
28992 }
28993 for val in &self.pos_variance {
28994 __tmp.put_f32_le(*val);
28995 }
28996 for val in &self.q {
28997 __tmp.put_f32_le(*val);
28998 }
28999 __tmp.put_f32_le(self.roll_rate);
29000 __tmp.put_f32_le(self.pitch_rate);
29001 __tmp.put_f32_le(self.yaw_rate);
29002 if matches!(version, MavlinkVersion::V2) {
29003 let len = __tmp.len();
29004 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29005 } else {
29006 __tmp.len()
29007 }
29008 }
29009}
29010#[doc = "id: 32"]
29011#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
29012#[derive(Debug, Clone, PartialEq)]
29013#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29014#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29015pub struct LOCAL_POSITION_NED_DATA {
29016 #[doc = "Timestamp (time since system boot)."]
29017 pub time_boot_ms: u32,
29018 #[doc = "X Position"]
29019 pub x: f32,
29020 #[doc = "Y Position"]
29021 pub y: f32,
29022 #[doc = "Z Position"]
29023 pub z: f32,
29024 #[doc = "X Speed"]
29025 pub vx: f32,
29026 #[doc = "Y Speed"]
29027 pub vy: f32,
29028 #[doc = "Z Speed"]
29029 pub vz: f32,
29030}
29031impl LOCAL_POSITION_NED_DATA {
29032 pub const ENCODED_LEN: usize = 28usize;
29033 pub const DEFAULT: Self = Self {
29034 time_boot_ms: 0_u32,
29035 x: 0.0_f32,
29036 y: 0.0_f32,
29037 z: 0.0_f32,
29038 vx: 0.0_f32,
29039 vy: 0.0_f32,
29040 vz: 0.0_f32,
29041 };
29042 #[cfg(feature = "arbitrary")]
29043 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29044 use arbitrary::{Arbitrary, Unstructured};
29045 let mut buf = [0u8; 1024];
29046 rng.fill_bytes(&mut buf);
29047 let mut unstructured = Unstructured::new(&buf);
29048 Self::arbitrary(&mut unstructured).unwrap_or_default()
29049 }
29050}
29051impl Default for LOCAL_POSITION_NED_DATA {
29052 fn default() -> Self {
29053 Self::DEFAULT.clone()
29054 }
29055}
29056impl MessageData for LOCAL_POSITION_NED_DATA {
29057 type Message = MavMessage;
29058 const ID: u32 = 32u32;
29059 const NAME: &'static str = "LOCAL_POSITION_NED";
29060 const EXTRA_CRC: u8 = 185u8;
29061 const ENCODED_LEN: usize = 28usize;
29062 fn deser(
29063 _version: MavlinkVersion,
29064 __input: &[u8],
29065 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29066 let avail_len = __input.len();
29067 let mut payload_buf = [0; Self::ENCODED_LEN];
29068 let mut buf = if avail_len < Self::ENCODED_LEN {
29069 payload_buf[0..avail_len].copy_from_slice(__input);
29070 Bytes::new(&payload_buf)
29071 } else {
29072 Bytes::new(__input)
29073 };
29074 let mut __struct = Self::default();
29075 __struct.time_boot_ms = buf.get_u32_le();
29076 __struct.x = buf.get_f32_le();
29077 __struct.y = buf.get_f32_le();
29078 __struct.z = buf.get_f32_le();
29079 __struct.vx = buf.get_f32_le();
29080 __struct.vy = buf.get_f32_le();
29081 __struct.vz = buf.get_f32_le();
29082 Ok(__struct)
29083 }
29084 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29085 let mut __tmp = BytesMut::new(bytes);
29086 #[allow(clippy::absurd_extreme_comparisons)]
29087 #[allow(unused_comparisons)]
29088 if __tmp.remaining() < Self::ENCODED_LEN {
29089 panic!(
29090 "buffer is too small (need {} bytes, but got {})",
29091 Self::ENCODED_LEN,
29092 __tmp.remaining(),
29093 )
29094 }
29095 __tmp.put_u32_le(self.time_boot_ms);
29096 __tmp.put_f32_le(self.x);
29097 __tmp.put_f32_le(self.y);
29098 __tmp.put_f32_le(self.z);
29099 __tmp.put_f32_le(self.vx);
29100 __tmp.put_f32_le(self.vy);
29101 __tmp.put_f32_le(self.vz);
29102 if matches!(version, MavlinkVersion::V2) {
29103 let len = __tmp.len();
29104 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29105 } else {
29106 __tmp.len()
29107 }
29108 }
29109}
29110#[doc = "id: 67"]
29111#[doc = "Data stream status information."]
29112#[derive(Debug, Clone, PartialEq)]
29113#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29114#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29115pub struct DATA_STREAM_DATA {
29116 #[doc = "The message rate"]
29117 pub message_rate: u16,
29118 #[doc = "The ID of the requested data stream"]
29119 pub stream_id: u8,
29120 #[doc = "1 stream is enabled, 0 stream is stopped."]
29121 pub on_off: u8,
29122}
29123impl DATA_STREAM_DATA {
29124 pub const ENCODED_LEN: usize = 4usize;
29125 pub const DEFAULT: Self = Self {
29126 message_rate: 0_u16,
29127 stream_id: 0_u8,
29128 on_off: 0_u8,
29129 };
29130 #[cfg(feature = "arbitrary")]
29131 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29132 use arbitrary::{Arbitrary, Unstructured};
29133 let mut buf = [0u8; 1024];
29134 rng.fill_bytes(&mut buf);
29135 let mut unstructured = Unstructured::new(&buf);
29136 Self::arbitrary(&mut unstructured).unwrap_or_default()
29137 }
29138}
29139impl Default for DATA_STREAM_DATA {
29140 fn default() -> Self {
29141 Self::DEFAULT.clone()
29142 }
29143}
29144impl MessageData for DATA_STREAM_DATA {
29145 type Message = MavMessage;
29146 const ID: u32 = 67u32;
29147 const NAME: &'static str = "DATA_STREAM";
29148 const EXTRA_CRC: u8 = 21u8;
29149 const ENCODED_LEN: usize = 4usize;
29150 fn deser(
29151 _version: MavlinkVersion,
29152 __input: &[u8],
29153 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29154 let avail_len = __input.len();
29155 let mut payload_buf = [0; Self::ENCODED_LEN];
29156 let mut buf = if avail_len < Self::ENCODED_LEN {
29157 payload_buf[0..avail_len].copy_from_slice(__input);
29158 Bytes::new(&payload_buf)
29159 } else {
29160 Bytes::new(__input)
29161 };
29162 let mut __struct = Self::default();
29163 __struct.message_rate = buf.get_u16_le();
29164 __struct.stream_id = buf.get_u8();
29165 __struct.on_off = buf.get_u8();
29166 Ok(__struct)
29167 }
29168 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29169 let mut __tmp = BytesMut::new(bytes);
29170 #[allow(clippy::absurd_extreme_comparisons)]
29171 #[allow(unused_comparisons)]
29172 if __tmp.remaining() < Self::ENCODED_LEN {
29173 panic!(
29174 "buffer is too small (need {} bytes, but got {})",
29175 Self::ENCODED_LEN,
29176 __tmp.remaining(),
29177 )
29178 }
29179 __tmp.put_u16_le(self.message_rate);
29180 __tmp.put_u8(self.stream_id);
29181 __tmp.put_u8(self.on_off);
29182 if matches!(version, MavlinkVersion::V2) {
29183 let len = __tmp.len();
29184 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29185 } else {
29186 __tmp.len()
29187 }
29188 }
29189}
29190#[doc = "id: 134"]
29191#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29192#[derive(Debug, Clone, PartialEq)]
29193#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29194#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29195pub struct TERRAIN_DATA_DATA {
29196 #[doc = "Latitude of SW corner of first grid"]
29197 pub lat: i32,
29198 #[doc = "Longitude of SW corner of first grid"]
29199 pub lon: i32,
29200 #[doc = "Grid spacing"]
29201 pub grid_spacing: u16,
29202 #[doc = "Terrain data MSL"]
29203 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29204 pub data: [i16; 16],
29205 #[doc = "bit within the terrain request mask"]
29206 pub gridbit: u8,
29207}
29208impl TERRAIN_DATA_DATA {
29209 pub const ENCODED_LEN: usize = 43usize;
29210 pub const DEFAULT: Self = Self {
29211 lat: 0_i32,
29212 lon: 0_i32,
29213 grid_spacing: 0_u16,
29214 data: [0_i16; 16usize],
29215 gridbit: 0_u8,
29216 };
29217 #[cfg(feature = "arbitrary")]
29218 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29219 use arbitrary::{Arbitrary, Unstructured};
29220 let mut buf = [0u8; 1024];
29221 rng.fill_bytes(&mut buf);
29222 let mut unstructured = Unstructured::new(&buf);
29223 Self::arbitrary(&mut unstructured).unwrap_or_default()
29224 }
29225}
29226impl Default for TERRAIN_DATA_DATA {
29227 fn default() -> Self {
29228 Self::DEFAULT.clone()
29229 }
29230}
29231impl MessageData for TERRAIN_DATA_DATA {
29232 type Message = MavMessage;
29233 const ID: u32 = 134u32;
29234 const NAME: &'static str = "TERRAIN_DATA";
29235 const EXTRA_CRC: u8 = 229u8;
29236 const ENCODED_LEN: usize = 43usize;
29237 fn deser(
29238 _version: MavlinkVersion,
29239 __input: &[u8],
29240 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29241 let avail_len = __input.len();
29242 let mut payload_buf = [0; Self::ENCODED_LEN];
29243 let mut buf = if avail_len < Self::ENCODED_LEN {
29244 payload_buf[0..avail_len].copy_from_slice(__input);
29245 Bytes::new(&payload_buf)
29246 } else {
29247 Bytes::new(__input)
29248 };
29249 let mut __struct = Self::default();
29250 __struct.lat = buf.get_i32_le();
29251 __struct.lon = buf.get_i32_le();
29252 __struct.grid_spacing = buf.get_u16_le();
29253 for v in &mut __struct.data {
29254 let val = buf.get_i16_le();
29255 *v = val;
29256 }
29257 __struct.gridbit = buf.get_u8();
29258 Ok(__struct)
29259 }
29260 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29261 let mut __tmp = BytesMut::new(bytes);
29262 #[allow(clippy::absurd_extreme_comparisons)]
29263 #[allow(unused_comparisons)]
29264 if __tmp.remaining() < Self::ENCODED_LEN {
29265 panic!(
29266 "buffer is too small (need {} bytes, but got {})",
29267 Self::ENCODED_LEN,
29268 __tmp.remaining(),
29269 )
29270 }
29271 __tmp.put_i32_le(self.lat);
29272 __tmp.put_i32_le(self.lon);
29273 __tmp.put_u16_le(self.grid_spacing);
29274 for val in &self.data {
29275 __tmp.put_i16_le(*val);
29276 }
29277 __tmp.put_u8(self.gridbit);
29278 if matches!(version, MavlinkVersion::V2) {
29279 let len = __tmp.len();
29280 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29281 } else {
29282 __tmp.len()
29283 }
29284 }
29285}
29286#[doc = "id: 131"]
29287#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
29288#[derive(Debug, Clone, PartialEq)]
29289#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29290#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29291pub struct ENCAPSULATED_DATA_DATA {
29292 #[doc = "sequence number (starting with 0 on every transmission)"]
29293 pub seqnr: u16,
29294 #[doc = "image data bytes"]
29295 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29296 pub data: [u8; 253],
29297}
29298impl ENCAPSULATED_DATA_DATA {
29299 pub const ENCODED_LEN: usize = 255usize;
29300 pub const DEFAULT: Self = Self {
29301 seqnr: 0_u16,
29302 data: [0_u8; 253usize],
29303 };
29304 #[cfg(feature = "arbitrary")]
29305 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29306 use arbitrary::{Arbitrary, Unstructured};
29307 let mut buf = [0u8; 1024];
29308 rng.fill_bytes(&mut buf);
29309 let mut unstructured = Unstructured::new(&buf);
29310 Self::arbitrary(&mut unstructured).unwrap_or_default()
29311 }
29312}
29313impl Default for ENCAPSULATED_DATA_DATA {
29314 fn default() -> Self {
29315 Self::DEFAULT.clone()
29316 }
29317}
29318impl MessageData for ENCAPSULATED_DATA_DATA {
29319 type Message = MavMessage;
29320 const ID: u32 = 131u32;
29321 const NAME: &'static str = "ENCAPSULATED_DATA";
29322 const EXTRA_CRC: u8 = 223u8;
29323 const ENCODED_LEN: usize = 255usize;
29324 fn deser(
29325 _version: MavlinkVersion,
29326 __input: &[u8],
29327 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29328 let avail_len = __input.len();
29329 let mut payload_buf = [0; Self::ENCODED_LEN];
29330 let mut buf = if avail_len < Self::ENCODED_LEN {
29331 payload_buf[0..avail_len].copy_from_slice(__input);
29332 Bytes::new(&payload_buf)
29333 } else {
29334 Bytes::new(__input)
29335 };
29336 let mut __struct = Self::default();
29337 __struct.seqnr = buf.get_u16_le();
29338 for v in &mut __struct.data {
29339 let val = buf.get_u8();
29340 *v = val;
29341 }
29342 Ok(__struct)
29343 }
29344 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29345 let mut __tmp = BytesMut::new(bytes);
29346 #[allow(clippy::absurd_extreme_comparisons)]
29347 #[allow(unused_comparisons)]
29348 if __tmp.remaining() < Self::ENCODED_LEN {
29349 panic!(
29350 "buffer is too small (need {} bytes, but got {})",
29351 Self::ENCODED_LEN,
29352 __tmp.remaining(),
29353 )
29354 }
29355 __tmp.put_u16_le(self.seqnr);
29356 for val in &self.data {
29357 __tmp.put_u8(*val);
29358 }
29359 if matches!(version, MavlinkVersion::V2) {
29360 let len = __tmp.len();
29361 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29362 } else {
29363 __tmp.len()
29364 }
29365 }
29366}
29367#[doc = "id: 48"]
29368#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
29369#[derive(Debug, Clone, PartialEq)]
29370#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29371#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29372pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
29373 #[doc = "Latitude (WGS84)"]
29374 pub latitude: i32,
29375 #[doc = "Longitude (WGS84)"]
29376 pub longitude: i32,
29377 #[doc = "Altitude (MSL). Positive for up."]
29378 pub altitude: i32,
29379 #[doc = "System ID"]
29380 pub target_system: u8,
29381 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29382 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29383 pub time_usec: u64,
29384}
29385impl SET_GPS_GLOBAL_ORIGIN_DATA {
29386 pub const ENCODED_LEN: usize = 21usize;
29387 pub const DEFAULT: Self = Self {
29388 latitude: 0_i32,
29389 longitude: 0_i32,
29390 altitude: 0_i32,
29391 target_system: 0_u8,
29392 time_usec: 0_u64,
29393 };
29394 #[cfg(feature = "arbitrary")]
29395 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29396 use arbitrary::{Arbitrary, Unstructured};
29397 let mut buf = [0u8; 1024];
29398 rng.fill_bytes(&mut buf);
29399 let mut unstructured = Unstructured::new(&buf);
29400 Self::arbitrary(&mut unstructured).unwrap_or_default()
29401 }
29402}
29403impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
29404 fn default() -> Self {
29405 Self::DEFAULT.clone()
29406 }
29407}
29408impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
29409 type Message = MavMessage;
29410 const ID: u32 = 48u32;
29411 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
29412 const EXTRA_CRC: u8 = 41u8;
29413 const ENCODED_LEN: usize = 21usize;
29414 fn deser(
29415 _version: MavlinkVersion,
29416 __input: &[u8],
29417 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29418 let avail_len = __input.len();
29419 let mut payload_buf = [0; Self::ENCODED_LEN];
29420 let mut buf = if avail_len < Self::ENCODED_LEN {
29421 payload_buf[0..avail_len].copy_from_slice(__input);
29422 Bytes::new(&payload_buf)
29423 } else {
29424 Bytes::new(__input)
29425 };
29426 let mut __struct = Self::default();
29427 __struct.latitude = buf.get_i32_le();
29428 __struct.longitude = buf.get_i32_le();
29429 __struct.altitude = buf.get_i32_le();
29430 __struct.target_system = buf.get_u8();
29431 __struct.time_usec = buf.get_u64_le();
29432 Ok(__struct)
29433 }
29434 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29435 let mut __tmp = BytesMut::new(bytes);
29436 #[allow(clippy::absurd_extreme_comparisons)]
29437 #[allow(unused_comparisons)]
29438 if __tmp.remaining() < Self::ENCODED_LEN {
29439 panic!(
29440 "buffer is too small (need {} bytes, but got {})",
29441 Self::ENCODED_LEN,
29442 __tmp.remaining(),
29443 )
29444 }
29445 __tmp.put_i32_le(self.latitude);
29446 __tmp.put_i32_le(self.longitude);
29447 __tmp.put_i32_le(self.altitude);
29448 __tmp.put_u8(self.target_system);
29449 __tmp.put_u64_le(self.time_usec);
29450 if matches!(version, MavlinkVersion::V2) {
29451 let len = __tmp.len();
29452 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29453 } else {
29454 __tmp.len()
29455 }
29456 }
29457}
29458#[doc = "id: 92"]
29459#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
29460#[derive(Debug, Clone, PartialEq)]
29461#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29462#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29463pub struct HIL_RC_INPUTS_RAW_DATA {
29464 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29465 pub time_usec: u64,
29466 #[doc = "RC channel 1 value"]
29467 pub chan1_raw: u16,
29468 #[doc = "RC channel 2 value"]
29469 pub chan2_raw: u16,
29470 #[doc = "RC channel 3 value"]
29471 pub chan3_raw: u16,
29472 #[doc = "RC channel 4 value"]
29473 pub chan4_raw: u16,
29474 #[doc = "RC channel 5 value"]
29475 pub chan5_raw: u16,
29476 #[doc = "RC channel 6 value"]
29477 pub chan6_raw: u16,
29478 #[doc = "RC channel 7 value"]
29479 pub chan7_raw: u16,
29480 #[doc = "RC channel 8 value"]
29481 pub chan8_raw: u16,
29482 #[doc = "RC channel 9 value"]
29483 pub chan9_raw: u16,
29484 #[doc = "RC channel 10 value"]
29485 pub chan10_raw: u16,
29486 #[doc = "RC channel 11 value"]
29487 pub chan11_raw: u16,
29488 #[doc = "RC channel 12 value"]
29489 pub chan12_raw: u16,
29490 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
29491 pub rssi: u8,
29492}
29493impl HIL_RC_INPUTS_RAW_DATA {
29494 pub const ENCODED_LEN: usize = 33usize;
29495 pub const DEFAULT: Self = Self {
29496 time_usec: 0_u64,
29497 chan1_raw: 0_u16,
29498 chan2_raw: 0_u16,
29499 chan3_raw: 0_u16,
29500 chan4_raw: 0_u16,
29501 chan5_raw: 0_u16,
29502 chan6_raw: 0_u16,
29503 chan7_raw: 0_u16,
29504 chan8_raw: 0_u16,
29505 chan9_raw: 0_u16,
29506 chan10_raw: 0_u16,
29507 chan11_raw: 0_u16,
29508 chan12_raw: 0_u16,
29509 rssi: 0_u8,
29510 };
29511 #[cfg(feature = "arbitrary")]
29512 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29513 use arbitrary::{Arbitrary, Unstructured};
29514 let mut buf = [0u8; 1024];
29515 rng.fill_bytes(&mut buf);
29516 let mut unstructured = Unstructured::new(&buf);
29517 Self::arbitrary(&mut unstructured).unwrap_or_default()
29518 }
29519}
29520impl Default for HIL_RC_INPUTS_RAW_DATA {
29521 fn default() -> Self {
29522 Self::DEFAULT.clone()
29523 }
29524}
29525impl MessageData for HIL_RC_INPUTS_RAW_DATA {
29526 type Message = MavMessage;
29527 const ID: u32 = 92u32;
29528 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
29529 const EXTRA_CRC: u8 = 54u8;
29530 const ENCODED_LEN: usize = 33usize;
29531 fn deser(
29532 _version: MavlinkVersion,
29533 __input: &[u8],
29534 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29535 let avail_len = __input.len();
29536 let mut payload_buf = [0; Self::ENCODED_LEN];
29537 let mut buf = if avail_len < Self::ENCODED_LEN {
29538 payload_buf[0..avail_len].copy_from_slice(__input);
29539 Bytes::new(&payload_buf)
29540 } else {
29541 Bytes::new(__input)
29542 };
29543 let mut __struct = Self::default();
29544 __struct.time_usec = buf.get_u64_le();
29545 __struct.chan1_raw = buf.get_u16_le();
29546 __struct.chan2_raw = buf.get_u16_le();
29547 __struct.chan3_raw = buf.get_u16_le();
29548 __struct.chan4_raw = buf.get_u16_le();
29549 __struct.chan5_raw = buf.get_u16_le();
29550 __struct.chan6_raw = buf.get_u16_le();
29551 __struct.chan7_raw = buf.get_u16_le();
29552 __struct.chan8_raw = buf.get_u16_le();
29553 __struct.chan9_raw = buf.get_u16_le();
29554 __struct.chan10_raw = buf.get_u16_le();
29555 __struct.chan11_raw = buf.get_u16_le();
29556 __struct.chan12_raw = buf.get_u16_le();
29557 __struct.rssi = buf.get_u8();
29558 Ok(__struct)
29559 }
29560 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29561 let mut __tmp = BytesMut::new(bytes);
29562 #[allow(clippy::absurd_extreme_comparisons)]
29563 #[allow(unused_comparisons)]
29564 if __tmp.remaining() < Self::ENCODED_LEN {
29565 panic!(
29566 "buffer is too small (need {} bytes, but got {})",
29567 Self::ENCODED_LEN,
29568 __tmp.remaining(),
29569 )
29570 }
29571 __tmp.put_u64_le(self.time_usec);
29572 __tmp.put_u16_le(self.chan1_raw);
29573 __tmp.put_u16_le(self.chan2_raw);
29574 __tmp.put_u16_le(self.chan3_raw);
29575 __tmp.put_u16_le(self.chan4_raw);
29576 __tmp.put_u16_le(self.chan5_raw);
29577 __tmp.put_u16_le(self.chan6_raw);
29578 __tmp.put_u16_le(self.chan7_raw);
29579 __tmp.put_u16_le(self.chan8_raw);
29580 __tmp.put_u16_le(self.chan9_raw);
29581 __tmp.put_u16_le(self.chan10_raw);
29582 __tmp.put_u16_le(self.chan11_raw);
29583 __tmp.put_u16_le(self.chan12_raw);
29584 __tmp.put_u8(self.rssi);
29585 if matches!(version, MavlinkVersion::V2) {
29586 let len = __tmp.len();
29587 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29588 } else {
29589 __tmp.len()
29590 }
29591 }
29592}
29593#[doc = "id: 12904"]
29594#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
29595#[derive(Debug, Clone, PartialEq)]
29596#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29597#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29598pub struct OPEN_DRONE_ID_SYSTEM_DATA {
29599 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
29600 pub operator_latitude: i32,
29601 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
29602 pub operator_longitude: i32,
29603 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
29604 pub area_ceiling: f32,
29605 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
29606 pub area_floor: f32,
29607 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
29608 pub operator_altitude_geo: f32,
29609 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
29610 pub timestamp: u32,
29611 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
29612 pub area_count: u16,
29613 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
29614 pub area_radius: u16,
29615 #[doc = "System ID (0 for broadcast)."]
29616 pub target_system: u8,
29617 #[doc = "Component ID (0 for broadcast)."]
29618 pub target_component: u8,
29619 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
29620 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29621 pub id_or_mac: [u8; 20],
29622 #[doc = "Specifies the operator location type."]
29623 pub operator_location_type: MavOdidOperatorLocationType,
29624 #[doc = "Specifies the classification type of the UA."]
29625 pub classification_type: MavOdidClassificationType,
29626 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
29627 pub category_eu: MavOdidCategoryEu,
29628 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
29629 pub class_eu: MavOdidClassEu,
29630}
29631impl OPEN_DRONE_ID_SYSTEM_DATA {
29632 pub const ENCODED_LEN: usize = 54usize;
29633 pub const DEFAULT: Self = Self {
29634 operator_latitude: 0_i32,
29635 operator_longitude: 0_i32,
29636 area_ceiling: 0.0_f32,
29637 area_floor: 0.0_f32,
29638 operator_altitude_geo: 0.0_f32,
29639 timestamp: 0_u32,
29640 area_count: 0_u16,
29641 area_radius: 0_u16,
29642 target_system: 0_u8,
29643 target_component: 0_u8,
29644 id_or_mac: [0_u8; 20usize],
29645 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
29646 classification_type: MavOdidClassificationType::DEFAULT,
29647 category_eu: MavOdidCategoryEu::DEFAULT,
29648 class_eu: MavOdidClassEu::DEFAULT,
29649 };
29650 #[cfg(feature = "arbitrary")]
29651 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29652 use arbitrary::{Arbitrary, Unstructured};
29653 let mut buf = [0u8; 1024];
29654 rng.fill_bytes(&mut buf);
29655 let mut unstructured = Unstructured::new(&buf);
29656 Self::arbitrary(&mut unstructured).unwrap_or_default()
29657 }
29658}
29659impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
29660 fn default() -> Self {
29661 Self::DEFAULT.clone()
29662 }
29663}
29664impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
29665 type Message = MavMessage;
29666 const ID: u32 = 12904u32;
29667 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
29668 const EXTRA_CRC: u8 = 77u8;
29669 const ENCODED_LEN: usize = 54usize;
29670 fn deser(
29671 _version: MavlinkVersion,
29672 __input: &[u8],
29673 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29674 let avail_len = __input.len();
29675 let mut payload_buf = [0; Self::ENCODED_LEN];
29676 let mut buf = if avail_len < Self::ENCODED_LEN {
29677 payload_buf[0..avail_len].copy_from_slice(__input);
29678 Bytes::new(&payload_buf)
29679 } else {
29680 Bytes::new(__input)
29681 };
29682 let mut __struct = Self::default();
29683 __struct.operator_latitude = buf.get_i32_le();
29684 __struct.operator_longitude = buf.get_i32_le();
29685 __struct.area_ceiling = buf.get_f32_le();
29686 __struct.area_floor = buf.get_f32_le();
29687 __struct.operator_altitude_geo = buf.get_f32_le();
29688 __struct.timestamp = buf.get_u32_le();
29689 __struct.area_count = buf.get_u16_le();
29690 __struct.area_radius = buf.get_u16_le();
29691 __struct.target_system = buf.get_u8();
29692 __struct.target_component = buf.get_u8();
29693 for v in &mut __struct.id_or_mac {
29694 let val = buf.get_u8();
29695 *v = val;
29696 }
29697 let tmp = buf.get_u8();
29698 __struct.operator_location_type =
29699 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29700 enum_type: "MavOdidOperatorLocationType",
29701 value: tmp as u32,
29702 })?;
29703 let tmp = buf.get_u8();
29704 __struct.classification_type =
29705 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29706 enum_type: "MavOdidClassificationType",
29707 value: tmp as u32,
29708 })?;
29709 let tmp = buf.get_u8();
29710 __struct.category_eu =
29711 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29712 enum_type: "MavOdidCategoryEu",
29713 value: tmp as u32,
29714 })?;
29715 let tmp = buf.get_u8();
29716 __struct.class_eu =
29717 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
29718 enum_type: "MavOdidClassEu",
29719 value: tmp as u32,
29720 })?;
29721 Ok(__struct)
29722 }
29723 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29724 let mut __tmp = BytesMut::new(bytes);
29725 #[allow(clippy::absurd_extreme_comparisons)]
29726 #[allow(unused_comparisons)]
29727 if __tmp.remaining() < Self::ENCODED_LEN {
29728 panic!(
29729 "buffer is too small (need {} bytes, but got {})",
29730 Self::ENCODED_LEN,
29731 __tmp.remaining(),
29732 )
29733 }
29734 __tmp.put_i32_le(self.operator_latitude);
29735 __tmp.put_i32_le(self.operator_longitude);
29736 __tmp.put_f32_le(self.area_ceiling);
29737 __tmp.put_f32_le(self.area_floor);
29738 __tmp.put_f32_le(self.operator_altitude_geo);
29739 __tmp.put_u32_le(self.timestamp);
29740 __tmp.put_u16_le(self.area_count);
29741 __tmp.put_u16_le(self.area_radius);
29742 __tmp.put_u8(self.target_system);
29743 __tmp.put_u8(self.target_component);
29744 for val in &self.id_or_mac {
29745 __tmp.put_u8(*val);
29746 }
29747 __tmp.put_u8(self.operator_location_type as u8);
29748 __tmp.put_u8(self.classification_type as u8);
29749 __tmp.put_u8(self.category_eu as u8);
29750 __tmp.put_u8(self.class_eu as u8);
29751 if matches!(version, MavlinkVersion::V2) {
29752 let len = __tmp.len();
29753 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29754 } else {
29755 __tmp.len()
29756 }
29757 }
29758}
29759#[doc = "id: 109"]
29760#[doc = "Status generated by radio and injected into MAVLink stream."]
29761#[derive(Debug, Clone, PartialEq)]
29762#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29763#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29764pub struct RADIO_STATUS_DATA {
29765 #[doc = "Count of radio packet receive errors (since boot)."]
29766 pub rxerrors: u16,
29767 #[doc = "Count of error corrected radio packets (since boot)."]
29768 pub fixed: u16,
29769 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
29770 pub rssi: u8,
29771 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
29772 pub remrssi: u8,
29773 #[doc = "Remaining free transmitter buffer space."]
29774 pub txbuf: u8,
29775 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
29776 pub noise: u8,
29777 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
29778 pub remnoise: u8,
29779}
29780impl RADIO_STATUS_DATA {
29781 pub const ENCODED_LEN: usize = 9usize;
29782 pub const DEFAULT: Self = Self {
29783 rxerrors: 0_u16,
29784 fixed: 0_u16,
29785 rssi: 0_u8,
29786 remrssi: 0_u8,
29787 txbuf: 0_u8,
29788 noise: 0_u8,
29789 remnoise: 0_u8,
29790 };
29791 #[cfg(feature = "arbitrary")]
29792 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29793 use arbitrary::{Arbitrary, Unstructured};
29794 let mut buf = [0u8; 1024];
29795 rng.fill_bytes(&mut buf);
29796 let mut unstructured = Unstructured::new(&buf);
29797 Self::arbitrary(&mut unstructured).unwrap_or_default()
29798 }
29799}
29800impl Default for RADIO_STATUS_DATA {
29801 fn default() -> Self {
29802 Self::DEFAULT.clone()
29803 }
29804}
29805impl MessageData for RADIO_STATUS_DATA {
29806 type Message = MavMessage;
29807 const ID: u32 = 109u32;
29808 const NAME: &'static str = "RADIO_STATUS";
29809 const EXTRA_CRC: u8 = 185u8;
29810 const ENCODED_LEN: usize = 9usize;
29811 fn deser(
29812 _version: MavlinkVersion,
29813 __input: &[u8],
29814 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29815 let avail_len = __input.len();
29816 let mut payload_buf = [0; Self::ENCODED_LEN];
29817 let mut buf = if avail_len < Self::ENCODED_LEN {
29818 payload_buf[0..avail_len].copy_from_slice(__input);
29819 Bytes::new(&payload_buf)
29820 } else {
29821 Bytes::new(__input)
29822 };
29823 let mut __struct = Self::default();
29824 __struct.rxerrors = buf.get_u16_le();
29825 __struct.fixed = buf.get_u16_le();
29826 __struct.rssi = buf.get_u8();
29827 __struct.remrssi = buf.get_u8();
29828 __struct.txbuf = buf.get_u8();
29829 __struct.noise = buf.get_u8();
29830 __struct.remnoise = buf.get_u8();
29831 Ok(__struct)
29832 }
29833 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29834 let mut __tmp = BytesMut::new(bytes);
29835 #[allow(clippy::absurd_extreme_comparisons)]
29836 #[allow(unused_comparisons)]
29837 if __tmp.remaining() < Self::ENCODED_LEN {
29838 panic!(
29839 "buffer is too small (need {} bytes, but got {})",
29840 Self::ENCODED_LEN,
29841 __tmp.remaining(),
29842 )
29843 }
29844 __tmp.put_u16_le(self.rxerrors);
29845 __tmp.put_u16_le(self.fixed);
29846 __tmp.put_u8(self.rssi);
29847 __tmp.put_u8(self.remrssi);
29848 __tmp.put_u8(self.txbuf);
29849 __tmp.put_u8(self.noise);
29850 __tmp.put_u8(self.remnoise);
29851 if matches!(version, MavlinkVersion::V2) {
29852 let len = __tmp.len();
29853 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29854 } else {
29855 __tmp.len()
29856 }
29857 }
29858}
29859#[doc = "id: 116"]
29860#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
29861#[derive(Debug, Clone, PartialEq)]
29862#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29863#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29864pub struct SCALED_IMU2_DATA {
29865 #[doc = "Timestamp (time since system boot)."]
29866 pub time_boot_ms: u32,
29867 #[doc = "X acceleration"]
29868 pub xacc: i16,
29869 #[doc = "Y acceleration"]
29870 pub yacc: i16,
29871 #[doc = "Z acceleration"]
29872 pub zacc: i16,
29873 #[doc = "Angular speed around X axis"]
29874 pub xgyro: i16,
29875 #[doc = "Angular speed around Y axis"]
29876 pub ygyro: i16,
29877 #[doc = "Angular speed around Z axis"]
29878 pub zgyro: i16,
29879 #[doc = "X Magnetic field"]
29880 pub xmag: i16,
29881 #[doc = "Y Magnetic field"]
29882 pub ymag: i16,
29883 #[doc = "Z Magnetic field"]
29884 pub zmag: i16,
29885 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
29886 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29887 pub temperature: i16,
29888}
29889impl SCALED_IMU2_DATA {
29890 pub const ENCODED_LEN: usize = 24usize;
29891 pub const DEFAULT: Self = Self {
29892 time_boot_ms: 0_u32,
29893 xacc: 0_i16,
29894 yacc: 0_i16,
29895 zacc: 0_i16,
29896 xgyro: 0_i16,
29897 ygyro: 0_i16,
29898 zgyro: 0_i16,
29899 xmag: 0_i16,
29900 ymag: 0_i16,
29901 zmag: 0_i16,
29902 temperature: 0_i16,
29903 };
29904 #[cfg(feature = "arbitrary")]
29905 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29906 use arbitrary::{Arbitrary, Unstructured};
29907 let mut buf = [0u8; 1024];
29908 rng.fill_bytes(&mut buf);
29909 let mut unstructured = Unstructured::new(&buf);
29910 Self::arbitrary(&mut unstructured).unwrap_or_default()
29911 }
29912}
29913impl Default for SCALED_IMU2_DATA {
29914 fn default() -> Self {
29915 Self::DEFAULT.clone()
29916 }
29917}
29918impl MessageData for SCALED_IMU2_DATA {
29919 type Message = MavMessage;
29920 const ID: u32 = 116u32;
29921 const NAME: &'static str = "SCALED_IMU2";
29922 const EXTRA_CRC: u8 = 76u8;
29923 const ENCODED_LEN: usize = 24usize;
29924 fn deser(
29925 _version: MavlinkVersion,
29926 __input: &[u8],
29927 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29928 let avail_len = __input.len();
29929 let mut payload_buf = [0; Self::ENCODED_LEN];
29930 let mut buf = if avail_len < Self::ENCODED_LEN {
29931 payload_buf[0..avail_len].copy_from_slice(__input);
29932 Bytes::new(&payload_buf)
29933 } else {
29934 Bytes::new(__input)
29935 };
29936 let mut __struct = Self::default();
29937 __struct.time_boot_ms = buf.get_u32_le();
29938 __struct.xacc = buf.get_i16_le();
29939 __struct.yacc = buf.get_i16_le();
29940 __struct.zacc = buf.get_i16_le();
29941 __struct.xgyro = buf.get_i16_le();
29942 __struct.ygyro = buf.get_i16_le();
29943 __struct.zgyro = buf.get_i16_le();
29944 __struct.xmag = buf.get_i16_le();
29945 __struct.ymag = buf.get_i16_le();
29946 __struct.zmag = buf.get_i16_le();
29947 __struct.temperature = buf.get_i16_le();
29948 Ok(__struct)
29949 }
29950 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29951 let mut __tmp = BytesMut::new(bytes);
29952 #[allow(clippy::absurd_extreme_comparisons)]
29953 #[allow(unused_comparisons)]
29954 if __tmp.remaining() < Self::ENCODED_LEN {
29955 panic!(
29956 "buffer is too small (need {} bytes, but got {})",
29957 Self::ENCODED_LEN,
29958 __tmp.remaining(),
29959 )
29960 }
29961 __tmp.put_u32_le(self.time_boot_ms);
29962 __tmp.put_i16_le(self.xacc);
29963 __tmp.put_i16_le(self.yacc);
29964 __tmp.put_i16_le(self.zacc);
29965 __tmp.put_i16_le(self.xgyro);
29966 __tmp.put_i16_le(self.ygyro);
29967 __tmp.put_i16_le(self.zgyro);
29968 __tmp.put_i16_le(self.xmag);
29969 __tmp.put_i16_le(self.ymag);
29970 __tmp.put_i16_le(self.zmag);
29971 __tmp.put_i16_le(self.temperature);
29972 if matches!(version, MavlinkVersion::V2) {
29973 let len = __tmp.len();
29974 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29975 } else {
29976 __tmp.len()
29977 }
29978 }
29979}
29980#[doc = "id: 371"]
29981#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
29982#[derive(Debug, Clone, PartialEq)]
29983#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29984#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29985pub struct FUEL_STATUS_DATA {
29986 #[doc = "Capacity when full. Must be provided."]
29987 pub maximum_fuel: f32,
29988 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
29989 pub consumed_fuel: f32,
29990 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
29991 pub remaining_fuel: f32,
29992 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
29993 pub flow_rate: f32,
29994 #[doc = "Fuel temperature. NaN: field not provided."]
29995 pub temperature: f32,
29996 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
29997 pub fuel_type: MavFuelType,
29998 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
29999 pub id: u8,
30000 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
30001 pub percent_remaining: u8,
30002}
30003impl FUEL_STATUS_DATA {
30004 pub const ENCODED_LEN: usize = 26usize;
30005 pub const DEFAULT: Self = Self {
30006 maximum_fuel: 0.0_f32,
30007 consumed_fuel: 0.0_f32,
30008 remaining_fuel: 0.0_f32,
30009 flow_rate: 0.0_f32,
30010 temperature: 0.0_f32,
30011 fuel_type: MavFuelType::DEFAULT,
30012 id: 0_u8,
30013 percent_remaining: 0_u8,
30014 };
30015 #[cfg(feature = "arbitrary")]
30016 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30017 use arbitrary::{Arbitrary, Unstructured};
30018 let mut buf = [0u8; 1024];
30019 rng.fill_bytes(&mut buf);
30020 let mut unstructured = Unstructured::new(&buf);
30021 Self::arbitrary(&mut unstructured).unwrap_or_default()
30022 }
30023}
30024impl Default for FUEL_STATUS_DATA {
30025 fn default() -> Self {
30026 Self::DEFAULT.clone()
30027 }
30028}
30029impl MessageData for FUEL_STATUS_DATA {
30030 type Message = MavMessage;
30031 const ID: u32 = 371u32;
30032 const NAME: &'static str = "FUEL_STATUS";
30033 const EXTRA_CRC: u8 = 10u8;
30034 const ENCODED_LEN: usize = 26usize;
30035 fn deser(
30036 _version: MavlinkVersion,
30037 __input: &[u8],
30038 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30039 let avail_len = __input.len();
30040 let mut payload_buf = [0; Self::ENCODED_LEN];
30041 let mut buf = if avail_len < Self::ENCODED_LEN {
30042 payload_buf[0..avail_len].copy_from_slice(__input);
30043 Bytes::new(&payload_buf)
30044 } else {
30045 Bytes::new(__input)
30046 };
30047 let mut __struct = Self::default();
30048 __struct.maximum_fuel = buf.get_f32_le();
30049 __struct.consumed_fuel = buf.get_f32_le();
30050 __struct.remaining_fuel = buf.get_f32_le();
30051 __struct.flow_rate = buf.get_f32_le();
30052 __struct.temperature = buf.get_f32_le();
30053 let tmp = buf.get_u32_le();
30054 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
30055 ::mavlink_core::error::ParserError::InvalidEnum {
30056 enum_type: "MavFuelType",
30057 value: tmp as u32,
30058 },
30059 )?;
30060 __struct.id = buf.get_u8();
30061 __struct.percent_remaining = buf.get_u8();
30062 Ok(__struct)
30063 }
30064 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30065 let mut __tmp = BytesMut::new(bytes);
30066 #[allow(clippy::absurd_extreme_comparisons)]
30067 #[allow(unused_comparisons)]
30068 if __tmp.remaining() < Self::ENCODED_LEN {
30069 panic!(
30070 "buffer is too small (need {} bytes, but got {})",
30071 Self::ENCODED_LEN,
30072 __tmp.remaining(),
30073 )
30074 }
30075 __tmp.put_f32_le(self.maximum_fuel);
30076 __tmp.put_f32_le(self.consumed_fuel);
30077 __tmp.put_f32_le(self.remaining_fuel);
30078 __tmp.put_f32_le(self.flow_rate);
30079 __tmp.put_f32_le(self.temperature);
30080 __tmp.put_u32_le(self.fuel_type as u32);
30081 __tmp.put_u8(self.id);
30082 __tmp.put_u8(self.percent_remaining);
30083 if matches!(version, MavlinkVersion::V2) {
30084 let len = __tmp.len();
30085 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30086 } else {
30087 __tmp.len()
30088 }
30089 }
30090}
30091#[doc = "id: 401"]
30092#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
30093#[derive(Debug, Clone, PartialEq)]
30094#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30095#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30096pub struct SUPPORTED_TUNES_DATA {
30097 #[doc = "Bitfield of supported tune formats."]
30098 pub format: TuneFormat,
30099 #[doc = "System ID"]
30100 pub target_system: u8,
30101 #[doc = "Component ID"]
30102 pub target_component: u8,
30103}
30104impl SUPPORTED_TUNES_DATA {
30105 pub const ENCODED_LEN: usize = 6usize;
30106 pub const DEFAULT: Self = Self {
30107 format: TuneFormat::DEFAULT,
30108 target_system: 0_u8,
30109 target_component: 0_u8,
30110 };
30111 #[cfg(feature = "arbitrary")]
30112 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30113 use arbitrary::{Arbitrary, Unstructured};
30114 let mut buf = [0u8; 1024];
30115 rng.fill_bytes(&mut buf);
30116 let mut unstructured = Unstructured::new(&buf);
30117 Self::arbitrary(&mut unstructured).unwrap_or_default()
30118 }
30119}
30120impl Default for SUPPORTED_TUNES_DATA {
30121 fn default() -> Self {
30122 Self::DEFAULT.clone()
30123 }
30124}
30125impl MessageData for SUPPORTED_TUNES_DATA {
30126 type Message = MavMessage;
30127 const ID: u32 = 401u32;
30128 const NAME: &'static str = "SUPPORTED_TUNES";
30129 const EXTRA_CRC: u8 = 183u8;
30130 const ENCODED_LEN: usize = 6usize;
30131 fn deser(
30132 _version: MavlinkVersion,
30133 __input: &[u8],
30134 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30135 let avail_len = __input.len();
30136 let mut payload_buf = [0; Self::ENCODED_LEN];
30137 let mut buf = if avail_len < Self::ENCODED_LEN {
30138 payload_buf[0..avail_len].copy_from_slice(__input);
30139 Bytes::new(&payload_buf)
30140 } else {
30141 Bytes::new(__input)
30142 };
30143 let mut __struct = Self::default();
30144 let tmp = buf.get_u32_le();
30145 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
30146 ::mavlink_core::error::ParserError::InvalidEnum {
30147 enum_type: "TuneFormat",
30148 value: tmp as u32,
30149 },
30150 )?;
30151 __struct.target_system = buf.get_u8();
30152 __struct.target_component = buf.get_u8();
30153 Ok(__struct)
30154 }
30155 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30156 let mut __tmp = BytesMut::new(bytes);
30157 #[allow(clippy::absurd_extreme_comparisons)]
30158 #[allow(unused_comparisons)]
30159 if __tmp.remaining() < Self::ENCODED_LEN {
30160 panic!(
30161 "buffer is too small (need {} bytes, but got {})",
30162 Self::ENCODED_LEN,
30163 __tmp.remaining(),
30164 )
30165 }
30166 __tmp.put_u32_le(self.format as u32);
30167 __tmp.put_u8(self.target_system);
30168 __tmp.put_u8(self.target_component);
30169 if matches!(version, MavlinkVersion::V2) {
30170 let len = __tmp.len();
30171 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30172 } else {
30173 __tmp.len()
30174 }
30175 }
30176}
30177#[doc = "id: 192"]
30178#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
30179#[derive(Debug, Clone, PartialEq)]
30180#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30182pub struct MAG_CAL_REPORT_DATA {
30183 #[doc = "RMS milligauss residuals."]
30184 pub fitness: f32,
30185 #[doc = "X offset."]
30186 pub ofs_x: f32,
30187 #[doc = "Y offset."]
30188 pub ofs_y: f32,
30189 #[doc = "Z offset."]
30190 pub ofs_z: f32,
30191 #[doc = "X diagonal (matrix 11)."]
30192 pub diag_x: f32,
30193 #[doc = "Y diagonal (matrix 22)."]
30194 pub diag_y: f32,
30195 #[doc = "Z diagonal (matrix 33)."]
30196 pub diag_z: f32,
30197 #[doc = "X off-diagonal (matrix 12 and 21)."]
30198 pub offdiag_x: f32,
30199 #[doc = "Y off-diagonal (matrix 13 and 31)."]
30200 pub offdiag_y: f32,
30201 #[doc = "Z off-diagonal (matrix 32 and 23)."]
30202 pub offdiag_z: f32,
30203 #[doc = "Compass being calibrated."]
30204 pub compass_id: u8,
30205 #[doc = "Bitmask of compasses being calibrated."]
30206 pub cal_mask: u8,
30207 #[doc = "Calibration Status."]
30208 pub cal_status: MagCalStatus,
30209 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
30210 pub autosaved: u8,
30211 #[doc = "Confidence in orientation (higher is better)."]
30212 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30213 pub orientation_confidence: f32,
30214 #[doc = "orientation before calibration."]
30215 #[cfg_attr(feature = "serde", serde(default))]
30216 pub old_orientation: MavSensorOrientation,
30217 #[doc = "orientation after calibration."]
30218 #[cfg_attr(feature = "serde", serde(default))]
30219 pub new_orientation: MavSensorOrientation,
30220 #[doc = "field radius correction factor"]
30221 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30222 pub scale_factor: f32,
30223}
30224impl MAG_CAL_REPORT_DATA {
30225 pub const ENCODED_LEN: usize = 54usize;
30226 pub const DEFAULT: Self = Self {
30227 fitness: 0.0_f32,
30228 ofs_x: 0.0_f32,
30229 ofs_y: 0.0_f32,
30230 ofs_z: 0.0_f32,
30231 diag_x: 0.0_f32,
30232 diag_y: 0.0_f32,
30233 diag_z: 0.0_f32,
30234 offdiag_x: 0.0_f32,
30235 offdiag_y: 0.0_f32,
30236 offdiag_z: 0.0_f32,
30237 compass_id: 0_u8,
30238 cal_mask: 0_u8,
30239 cal_status: MagCalStatus::DEFAULT,
30240 autosaved: 0_u8,
30241 orientation_confidence: 0.0_f32,
30242 old_orientation: MavSensorOrientation::DEFAULT,
30243 new_orientation: MavSensorOrientation::DEFAULT,
30244 scale_factor: 0.0_f32,
30245 };
30246 #[cfg(feature = "arbitrary")]
30247 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30248 use arbitrary::{Arbitrary, Unstructured};
30249 let mut buf = [0u8; 1024];
30250 rng.fill_bytes(&mut buf);
30251 let mut unstructured = Unstructured::new(&buf);
30252 Self::arbitrary(&mut unstructured).unwrap_or_default()
30253 }
30254}
30255impl Default for MAG_CAL_REPORT_DATA {
30256 fn default() -> Self {
30257 Self::DEFAULT.clone()
30258 }
30259}
30260impl MessageData for MAG_CAL_REPORT_DATA {
30261 type Message = MavMessage;
30262 const ID: u32 = 192u32;
30263 const NAME: &'static str = "MAG_CAL_REPORT";
30264 const EXTRA_CRC: u8 = 36u8;
30265 const ENCODED_LEN: usize = 54usize;
30266 fn deser(
30267 _version: MavlinkVersion,
30268 __input: &[u8],
30269 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30270 let avail_len = __input.len();
30271 let mut payload_buf = [0; Self::ENCODED_LEN];
30272 let mut buf = if avail_len < Self::ENCODED_LEN {
30273 payload_buf[0..avail_len].copy_from_slice(__input);
30274 Bytes::new(&payload_buf)
30275 } else {
30276 Bytes::new(__input)
30277 };
30278 let mut __struct = Self::default();
30279 __struct.fitness = buf.get_f32_le();
30280 __struct.ofs_x = buf.get_f32_le();
30281 __struct.ofs_y = buf.get_f32_le();
30282 __struct.ofs_z = buf.get_f32_le();
30283 __struct.diag_x = buf.get_f32_le();
30284 __struct.diag_y = buf.get_f32_le();
30285 __struct.diag_z = buf.get_f32_le();
30286 __struct.offdiag_x = buf.get_f32_le();
30287 __struct.offdiag_y = buf.get_f32_le();
30288 __struct.offdiag_z = buf.get_f32_le();
30289 __struct.compass_id = buf.get_u8();
30290 __struct.cal_mask = buf.get_u8();
30291 let tmp = buf.get_u8();
30292 __struct.cal_status =
30293 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30294 enum_type: "MagCalStatus",
30295 value: tmp as u32,
30296 })?;
30297 __struct.autosaved = buf.get_u8();
30298 __struct.orientation_confidence = buf.get_f32_le();
30299 let tmp = buf.get_u8();
30300 __struct.old_orientation =
30301 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30302 enum_type: "MavSensorOrientation",
30303 value: tmp as u32,
30304 })?;
30305 let tmp = buf.get_u8();
30306 __struct.new_orientation =
30307 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30308 enum_type: "MavSensorOrientation",
30309 value: tmp as u32,
30310 })?;
30311 __struct.scale_factor = buf.get_f32_le();
30312 Ok(__struct)
30313 }
30314 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30315 let mut __tmp = BytesMut::new(bytes);
30316 #[allow(clippy::absurd_extreme_comparisons)]
30317 #[allow(unused_comparisons)]
30318 if __tmp.remaining() < Self::ENCODED_LEN {
30319 panic!(
30320 "buffer is too small (need {} bytes, but got {})",
30321 Self::ENCODED_LEN,
30322 __tmp.remaining(),
30323 )
30324 }
30325 __tmp.put_f32_le(self.fitness);
30326 __tmp.put_f32_le(self.ofs_x);
30327 __tmp.put_f32_le(self.ofs_y);
30328 __tmp.put_f32_le(self.ofs_z);
30329 __tmp.put_f32_le(self.diag_x);
30330 __tmp.put_f32_le(self.diag_y);
30331 __tmp.put_f32_le(self.diag_z);
30332 __tmp.put_f32_le(self.offdiag_x);
30333 __tmp.put_f32_le(self.offdiag_y);
30334 __tmp.put_f32_le(self.offdiag_z);
30335 __tmp.put_u8(self.compass_id);
30336 __tmp.put_u8(self.cal_mask);
30337 __tmp.put_u8(self.cal_status as u8);
30338 __tmp.put_u8(self.autosaved);
30339 __tmp.put_f32_le(self.orientation_confidence);
30340 __tmp.put_u8(self.old_orientation as u8);
30341 __tmp.put_u8(self.new_orientation as u8);
30342 __tmp.put_f32_le(self.scale_factor);
30343 if matches!(version, MavlinkVersion::V2) {
30344 let len = __tmp.len();
30345 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30346 } else {
30347 __tmp.len()
30348 }
30349 }
30350}
30351#[doc = "id: 125"]
30352#[doc = "Power supply status."]
30353#[derive(Debug, Clone, PartialEq)]
30354#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30355#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30356pub struct POWER_STATUS_DATA {
30357 #[doc = "5V rail voltage."]
30358 pub Vcc: u16,
30359 #[doc = "Servo rail voltage."]
30360 pub Vservo: u16,
30361 #[doc = "Bitmap of power supply status flags."]
30362 pub flags: MavPowerStatus,
30363}
30364impl POWER_STATUS_DATA {
30365 pub const ENCODED_LEN: usize = 6usize;
30366 pub const DEFAULT: Self = Self {
30367 Vcc: 0_u16,
30368 Vservo: 0_u16,
30369 flags: MavPowerStatus::DEFAULT,
30370 };
30371 #[cfg(feature = "arbitrary")]
30372 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30373 use arbitrary::{Arbitrary, Unstructured};
30374 let mut buf = [0u8; 1024];
30375 rng.fill_bytes(&mut buf);
30376 let mut unstructured = Unstructured::new(&buf);
30377 Self::arbitrary(&mut unstructured).unwrap_or_default()
30378 }
30379}
30380impl Default for POWER_STATUS_DATA {
30381 fn default() -> Self {
30382 Self::DEFAULT.clone()
30383 }
30384}
30385impl MessageData for POWER_STATUS_DATA {
30386 type Message = MavMessage;
30387 const ID: u32 = 125u32;
30388 const NAME: &'static str = "POWER_STATUS";
30389 const EXTRA_CRC: u8 = 203u8;
30390 const ENCODED_LEN: usize = 6usize;
30391 fn deser(
30392 _version: MavlinkVersion,
30393 __input: &[u8],
30394 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30395 let avail_len = __input.len();
30396 let mut payload_buf = [0; Self::ENCODED_LEN];
30397 let mut buf = if avail_len < Self::ENCODED_LEN {
30398 payload_buf[0..avail_len].copy_from_slice(__input);
30399 Bytes::new(&payload_buf)
30400 } else {
30401 Bytes::new(__input)
30402 };
30403 let mut __struct = Self::default();
30404 __struct.Vcc = buf.get_u16_le();
30405 __struct.Vservo = buf.get_u16_le();
30406 let tmp = buf.get_u16_le();
30407 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
30408 ::mavlink_core::error::ParserError::InvalidFlag {
30409 flag_type: "MavPowerStatus",
30410 value: tmp as u32,
30411 },
30412 )?;
30413 Ok(__struct)
30414 }
30415 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30416 let mut __tmp = BytesMut::new(bytes);
30417 #[allow(clippy::absurd_extreme_comparisons)]
30418 #[allow(unused_comparisons)]
30419 if __tmp.remaining() < Self::ENCODED_LEN {
30420 panic!(
30421 "buffer is too small (need {} bytes, but got {})",
30422 Self::ENCODED_LEN,
30423 __tmp.remaining(),
30424 )
30425 }
30426 __tmp.put_u16_le(self.Vcc);
30427 __tmp.put_u16_le(self.Vservo);
30428 __tmp.put_u16_le(self.flags.bits());
30429 if matches!(version, MavlinkVersion::V2) {
30430 let len = __tmp.len();
30431 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30432 } else {
30433 __tmp.len()
30434 }
30435 }
30436}
30437#[doc = "id: 20"]
30438#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
30439#[derive(Debug, Clone, PartialEq)]
30440#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30441#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30442pub struct PARAM_REQUEST_READ_DATA {
30443 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
30444 pub param_index: i16,
30445 #[doc = "System ID"]
30446 pub target_system: u8,
30447 #[doc = "Component ID"]
30448 pub target_component: u8,
30449 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
30450 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30451 pub param_id: [u8; 16],
30452}
30453impl PARAM_REQUEST_READ_DATA {
30454 pub const ENCODED_LEN: usize = 20usize;
30455 pub const DEFAULT: Self = Self {
30456 param_index: 0_i16,
30457 target_system: 0_u8,
30458 target_component: 0_u8,
30459 param_id: [0_u8; 16usize],
30460 };
30461 #[cfg(feature = "arbitrary")]
30462 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30463 use arbitrary::{Arbitrary, Unstructured};
30464 let mut buf = [0u8; 1024];
30465 rng.fill_bytes(&mut buf);
30466 let mut unstructured = Unstructured::new(&buf);
30467 Self::arbitrary(&mut unstructured).unwrap_or_default()
30468 }
30469}
30470impl Default for PARAM_REQUEST_READ_DATA {
30471 fn default() -> Self {
30472 Self::DEFAULT.clone()
30473 }
30474}
30475impl MessageData for PARAM_REQUEST_READ_DATA {
30476 type Message = MavMessage;
30477 const ID: u32 = 20u32;
30478 const NAME: &'static str = "PARAM_REQUEST_READ";
30479 const EXTRA_CRC: u8 = 214u8;
30480 const ENCODED_LEN: usize = 20usize;
30481 fn deser(
30482 _version: MavlinkVersion,
30483 __input: &[u8],
30484 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30485 let avail_len = __input.len();
30486 let mut payload_buf = [0; Self::ENCODED_LEN];
30487 let mut buf = if avail_len < Self::ENCODED_LEN {
30488 payload_buf[0..avail_len].copy_from_slice(__input);
30489 Bytes::new(&payload_buf)
30490 } else {
30491 Bytes::new(__input)
30492 };
30493 let mut __struct = Self::default();
30494 __struct.param_index = buf.get_i16_le();
30495 __struct.target_system = buf.get_u8();
30496 __struct.target_component = buf.get_u8();
30497 for v in &mut __struct.param_id {
30498 let val = buf.get_u8();
30499 *v = val;
30500 }
30501 Ok(__struct)
30502 }
30503 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30504 let mut __tmp = BytesMut::new(bytes);
30505 #[allow(clippy::absurd_extreme_comparisons)]
30506 #[allow(unused_comparisons)]
30507 if __tmp.remaining() < Self::ENCODED_LEN {
30508 panic!(
30509 "buffer is too small (need {} bytes, but got {})",
30510 Self::ENCODED_LEN,
30511 __tmp.remaining(),
30512 )
30513 }
30514 __tmp.put_i16_le(self.param_index);
30515 __tmp.put_u8(self.target_system);
30516 __tmp.put_u8(self.target_component);
30517 for val in &self.param_id {
30518 __tmp.put_u8(*val);
30519 }
30520 if matches!(version, MavlinkVersion::V2) {
30521 let len = __tmp.len();
30522 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30523 } else {
30524 __tmp.len()
30525 }
30526 }
30527}
30528#[doc = "id: 129"]
30529#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
30530#[derive(Debug, Clone, PartialEq)]
30531#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30533pub struct SCALED_IMU3_DATA {
30534 #[doc = "Timestamp (time since system boot)."]
30535 pub time_boot_ms: u32,
30536 #[doc = "X acceleration"]
30537 pub xacc: i16,
30538 #[doc = "Y acceleration"]
30539 pub yacc: i16,
30540 #[doc = "Z acceleration"]
30541 pub zacc: i16,
30542 #[doc = "Angular speed around X axis"]
30543 pub xgyro: i16,
30544 #[doc = "Angular speed around Y axis"]
30545 pub ygyro: i16,
30546 #[doc = "Angular speed around Z axis"]
30547 pub zgyro: i16,
30548 #[doc = "X Magnetic field"]
30549 pub xmag: i16,
30550 #[doc = "Y Magnetic field"]
30551 pub ymag: i16,
30552 #[doc = "Z Magnetic field"]
30553 pub zmag: i16,
30554 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
30555 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30556 pub temperature: i16,
30557}
30558impl SCALED_IMU3_DATA {
30559 pub const ENCODED_LEN: usize = 24usize;
30560 pub const DEFAULT: Self = Self {
30561 time_boot_ms: 0_u32,
30562 xacc: 0_i16,
30563 yacc: 0_i16,
30564 zacc: 0_i16,
30565 xgyro: 0_i16,
30566 ygyro: 0_i16,
30567 zgyro: 0_i16,
30568 xmag: 0_i16,
30569 ymag: 0_i16,
30570 zmag: 0_i16,
30571 temperature: 0_i16,
30572 };
30573 #[cfg(feature = "arbitrary")]
30574 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30575 use arbitrary::{Arbitrary, Unstructured};
30576 let mut buf = [0u8; 1024];
30577 rng.fill_bytes(&mut buf);
30578 let mut unstructured = Unstructured::new(&buf);
30579 Self::arbitrary(&mut unstructured).unwrap_or_default()
30580 }
30581}
30582impl Default for SCALED_IMU3_DATA {
30583 fn default() -> Self {
30584 Self::DEFAULT.clone()
30585 }
30586}
30587impl MessageData for SCALED_IMU3_DATA {
30588 type Message = MavMessage;
30589 const ID: u32 = 129u32;
30590 const NAME: &'static str = "SCALED_IMU3";
30591 const EXTRA_CRC: u8 = 46u8;
30592 const ENCODED_LEN: usize = 24usize;
30593 fn deser(
30594 _version: MavlinkVersion,
30595 __input: &[u8],
30596 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30597 let avail_len = __input.len();
30598 let mut payload_buf = [0; Self::ENCODED_LEN];
30599 let mut buf = if avail_len < Self::ENCODED_LEN {
30600 payload_buf[0..avail_len].copy_from_slice(__input);
30601 Bytes::new(&payload_buf)
30602 } else {
30603 Bytes::new(__input)
30604 };
30605 let mut __struct = Self::default();
30606 __struct.time_boot_ms = buf.get_u32_le();
30607 __struct.xacc = buf.get_i16_le();
30608 __struct.yacc = buf.get_i16_le();
30609 __struct.zacc = buf.get_i16_le();
30610 __struct.xgyro = buf.get_i16_le();
30611 __struct.ygyro = buf.get_i16_le();
30612 __struct.zgyro = buf.get_i16_le();
30613 __struct.xmag = buf.get_i16_le();
30614 __struct.ymag = buf.get_i16_le();
30615 __struct.zmag = buf.get_i16_le();
30616 __struct.temperature = buf.get_i16_le();
30617 Ok(__struct)
30618 }
30619 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30620 let mut __tmp = BytesMut::new(bytes);
30621 #[allow(clippy::absurd_extreme_comparisons)]
30622 #[allow(unused_comparisons)]
30623 if __tmp.remaining() < Self::ENCODED_LEN {
30624 panic!(
30625 "buffer is too small (need {} bytes, but got {})",
30626 Self::ENCODED_LEN,
30627 __tmp.remaining(),
30628 )
30629 }
30630 __tmp.put_u32_le(self.time_boot_ms);
30631 __tmp.put_i16_le(self.xacc);
30632 __tmp.put_i16_le(self.yacc);
30633 __tmp.put_i16_le(self.zacc);
30634 __tmp.put_i16_le(self.xgyro);
30635 __tmp.put_i16_le(self.ygyro);
30636 __tmp.put_i16_le(self.zgyro);
30637 __tmp.put_i16_le(self.xmag);
30638 __tmp.put_i16_le(self.ymag);
30639 __tmp.put_i16_le(self.zmag);
30640 __tmp.put_i16_le(self.temperature);
30641 if matches!(version, MavlinkVersion::V2) {
30642 let len = __tmp.len();
30643 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30644 } else {
30645 __tmp.len()
30646 }
30647 }
30648}
30649#[doc = "id: 252"]
30650#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
30651#[derive(Debug, Clone, PartialEq)]
30652#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30653#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30654pub struct NAMED_VALUE_INT_DATA {
30655 #[doc = "Timestamp (time since system boot)."]
30656 pub time_boot_ms: u32,
30657 #[doc = "Signed integer value"]
30658 pub value: i32,
30659 #[doc = "Name of the debug variable"]
30660 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30661 pub name: [u8; 10],
30662}
30663impl NAMED_VALUE_INT_DATA {
30664 pub const ENCODED_LEN: usize = 18usize;
30665 pub const DEFAULT: Self = Self {
30666 time_boot_ms: 0_u32,
30667 value: 0_i32,
30668 name: [0_u8; 10usize],
30669 };
30670 #[cfg(feature = "arbitrary")]
30671 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30672 use arbitrary::{Arbitrary, Unstructured};
30673 let mut buf = [0u8; 1024];
30674 rng.fill_bytes(&mut buf);
30675 let mut unstructured = Unstructured::new(&buf);
30676 Self::arbitrary(&mut unstructured).unwrap_or_default()
30677 }
30678}
30679impl Default for NAMED_VALUE_INT_DATA {
30680 fn default() -> Self {
30681 Self::DEFAULT.clone()
30682 }
30683}
30684impl MessageData for NAMED_VALUE_INT_DATA {
30685 type Message = MavMessage;
30686 const ID: u32 = 252u32;
30687 const NAME: &'static str = "NAMED_VALUE_INT";
30688 const EXTRA_CRC: u8 = 44u8;
30689 const ENCODED_LEN: usize = 18usize;
30690 fn deser(
30691 _version: MavlinkVersion,
30692 __input: &[u8],
30693 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30694 let avail_len = __input.len();
30695 let mut payload_buf = [0; Self::ENCODED_LEN];
30696 let mut buf = if avail_len < Self::ENCODED_LEN {
30697 payload_buf[0..avail_len].copy_from_slice(__input);
30698 Bytes::new(&payload_buf)
30699 } else {
30700 Bytes::new(__input)
30701 };
30702 let mut __struct = Self::default();
30703 __struct.time_boot_ms = buf.get_u32_le();
30704 __struct.value = buf.get_i32_le();
30705 for v in &mut __struct.name {
30706 let val = buf.get_u8();
30707 *v = val;
30708 }
30709 Ok(__struct)
30710 }
30711 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30712 let mut __tmp = BytesMut::new(bytes);
30713 #[allow(clippy::absurd_extreme_comparisons)]
30714 #[allow(unused_comparisons)]
30715 if __tmp.remaining() < Self::ENCODED_LEN {
30716 panic!(
30717 "buffer is too small (need {} bytes, but got {})",
30718 Self::ENCODED_LEN,
30719 __tmp.remaining(),
30720 )
30721 }
30722 __tmp.put_u32_le(self.time_boot_ms);
30723 __tmp.put_i32_le(self.value);
30724 for val in &self.name {
30725 __tmp.put_u8(*val);
30726 }
30727 if matches!(version, MavlinkVersion::V2) {
30728 let len = __tmp.len();
30729 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30730 } else {
30731 __tmp.len()
30732 }
30733 }
30734}
30735#[doc = "id: 275"]
30736#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
30737#[derive(Debug, Clone, PartialEq)]
30738#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30739#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30740pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
30741 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
30742 pub point_x: f32,
30743 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
30744 pub point_y: f32,
30745 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
30746 pub radius: f32,
30747 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
30748 pub rec_top_x: f32,
30749 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
30750 pub rec_top_y: f32,
30751 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
30752 pub rec_bottom_x: f32,
30753 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
30754 pub rec_bottom_y: f32,
30755 #[doc = "Current tracking status"]
30756 pub tracking_status: CameraTrackingStatusFlags,
30757 #[doc = "Current tracking mode"]
30758 pub tracking_mode: CameraTrackingMode,
30759 #[doc = "Defines location of target data"]
30760 pub target_data: CameraTrackingTargetData,
30761 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30762 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30763 pub camera_device_id: u8,
30764}
30765impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
30766 pub const ENCODED_LEN: usize = 32usize;
30767 pub const DEFAULT: Self = Self {
30768 point_x: 0.0_f32,
30769 point_y: 0.0_f32,
30770 radius: 0.0_f32,
30771 rec_top_x: 0.0_f32,
30772 rec_top_y: 0.0_f32,
30773 rec_bottom_x: 0.0_f32,
30774 rec_bottom_y: 0.0_f32,
30775 tracking_status: CameraTrackingStatusFlags::DEFAULT,
30776 tracking_mode: CameraTrackingMode::DEFAULT,
30777 target_data: CameraTrackingTargetData::DEFAULT,
30778 camera_device_id: 0_u8,
30779 };
30780 #[cfg(feature = "arbitrary")]
30781 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30782 use arbitrary::{Arbitrary, Unstructured};
30783 let mut buf = [0u8; 1024];
30784 rng.fill_bytes(&mut buf);
30785 let mut unstructured = Unstructured::new(&buf);
30786 Self::arbitrary(&mut unstructured).unwrap_or_default()
30787 }
30788}
30789impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
30790 fn default() -> Self {
30791 Self::DEFAULT.clone()
30792 }
30793}
30794impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
30795 type Message = MavMessage;
30796 const ID: u32 = 275u32;
30797 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
30798 const EXTRA_CRC: u8 = 126u8;
30799 const ENCODED_LEN: usize = 32usize;
30800 fn deser(
30801 _version: MavlinkVersion,
30802 __input: &[u8],
30803 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30804 let avail_len = __input.len();
30805 let mut payload_buf = [0; Self::ENCODED_LEN];
30806 let mut buf = if avail_len < Self::ENCODED_LEN {
30807 payload_buf[0..avail_len].copy_from_slice(__input);
30808 Bytes::new(&payload_buf)
30809 } else {
30810 Bytes::new(__input)
30811 };
30812 let mut __struct = Self::default();
30813 __struct.point_x = buf.get_f32_le();
30814 __struct.point_y = buf.get_f32_le();
30815 __struct.radius = buf.get_f32_le();
30816 __struct.rec_top_x = buf.get_f32_le();
30817 __struct.rec_top_y = buf.get_f32_le();
30818 __struct.rec_bottom_x = buf.get_f32_le();
30819 __struct.rec_bottom_y = buf.get_f32_le();
30820 let tmp = buf.get_u8();
30821 __struct.tracking_status =
30822 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30823 enum_type: "CameraTrackingStatusFlags",
30824 value: tmp as u32,
30825 })?;
30826 let tmp = buf.get_u8();
30827 __struct.tracking_mode =
30828 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30829 enum_type: "CameraTrackingMode",
30830 value: tmp as u32,
30831 })?;
30832 let tmp = buf.get_u8();
30833 __struct.target_data =
30834 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
30835 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30836 flag_type: "CameraTrackingTargetData",
30837 value: tmp as u32,
30838 })?;
30839 __struct.camera_device_id = buf.get_u8();
30840 Ok(__struct)
30841 }
30842 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30843 let mut __tmp = BytesMut::new(bytes);
30844 #[allow(clippy::absurd_extreme_comparisons)]
30845 #[allow(unused_comparisons)]
30846 if __tmp.remaining() < Self::ENCODED_LEN {
30847 panic!(
30848 "buffer is too small (need {} bytes, but got {})",
30849 Self::ENCODED_LEN,
30850 __tmp.remaining(),
30851 )
30852 }
30853 __tmp.put_f32_le(self.point_x);
30854 __tmp.put_f32_le(self.point_y);
30855 __tmp.put_f32_le(self.radius);
30856 __tmp.put_f32_le(self.rec_top_x);
30857 __tmp.put_f32_le(self.rec_top_y);
30858 __tmp.put_f32_le(self.rec_bottom_x);
30859 __tmp.put_f32_le(self.rec_bottom_y);
30860 __tmp.put_u8(self.tracking_status as u8);
30861 __tmp.put_u8(self.tracking_mode as u8);
30862 __tmp.put_u8(self.target_data.bits());
30863 __tmp.put_u8(self.camera_device_id);
30864 if matches!(version, MavlinkVersion::V2) {
30865 let len = __tmp.len();
30866 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30867 } else {
30868 __tmp.len()
30869 }
30870 }
30871}
30872#[doc = "id: 81"]
30873#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
30874#[derive(Debug, Clone, PartialEq)]
30875#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30876#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30877pub struct MANUAL_SETPOINT_DATA {
30878 #[doc = "Timestamp (time since system boot)."]
30879 pub time_boot_ms: u32,
30880 #[doc = "Desired roll rate"]
30881 pub roll: f32,
30882 #[doc = "Desired pitch rate"]
30883 pub pitch: f32,
30884 #[doc = "Desired yaw rate"]
30885 pub yaw: f32,
30886 #[doc = "Collective thrust, normalized to 0 .. 1"]
30887 pub thrust: f32,
30888 #[doc = "Flight mode switch position, 0.. 255"]
30889 pub mode_switch: u8,
30890 #[doc = "Override mode switch position, 0.. 255"]
30891 pub manual_override_switch: u8,
30892}
30893impl MANUAL_SETPOINT_DATA {
30894 pub const ENCODED_LEN: usize = 22usize;
30895 pub const DEFAULT: Self = Self {
30896 time_boot_ms: 0_u32,
30897 roll: 0.0_f32,
30898 pitch: 0.0_f32,
30899 yaw: 0.0_f32,
30900 thrust: 0.0_f32,
30901 mode_switch: 0_u8,
30902 manual_override_switch: 0_u8,
30903 };
30904 #[cfg(feature = "arbitrary")]
30905 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30906 use arbitrary::{Arbitrary, Unstructured};
30907 let mut buf = [0u8; 1024];
30908 rng.fill_bytes(&mut buf);
30909 let mut unstructured = Unstructured::new(&buf);
30910 Self::arbitrary(&mut unstructured).unwrap_or_default()
30911 }
30912}
30913impl Default for MANUAL_SETPOINT_DATA {
30914 fn default() -> Self {
30915 Self::DEFAULT.clone()
30916 }
30917}
30918impl MessageData for MANUAL_SETPOINT_DATA {
30919 type Message = MavMessage;
30920 const ID: u32 = 81u32;
30921 const NAME: &'static str = "MANUAL_SETPOINT";
30922 const EXTRA_CRC: u8 = 106u8;
30923 const ENCODED_LEN: usize = 22usize;
30924 fn deser(
30925 _version: MavlinkVersion,
30926 __input: &[u8],
30927 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30928 let avail_len = __input.len();
30929 let mut payload_buf = [0; Self::ENCODED_LEN];
30930 let mut buf = if avail_len < Self::ENCODED_LEN {
30931 payload_buf[0..avail_len].copy_from_slice(__input);
30932 Bytes::new(&payload_buf)
30933 } else {
30934 Bytes::new(__input)
30935 };
30936 let mut __struct = Self::default();
30937 __struct.time_boot_ms = buf.get_u32_le();
30938 __struct.roll = buf.get_f32_le();
30939 __struct.pitch = buf.get_f32_le();
30940 __struct.yaw = buf.get_f32_le();
30941 __struct.thrust = buf.get_f32_le();
30942 __struct.mode_switch = buf.get_u8();
30943 __struct.manual_override_switch = buf.get_u8();
30944 Ok(__struct)
30945 }
30946 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30947 let mut __tmp = BytesMut::new(bytes);
30948 #[allow(clippy::absurd_extreme_comparisons)]
30949 #[allow(unused_comparisons)]
30950 if __tmp.remaining() < Self::ENCODED_LEN {
30951 panic!(
30952 "buffer is too small (need {} bytes, but got {})",
30953 Self::ENCODED_LEN,
30954 __tmp.remaining(),
30955 )
30956 }
30957 __tmp.put_u32_le(self.time_boot_ms);
30958 __tmp.put_f32_le(self.roll);
30959 __tmp.put_f32_le(self.pitch);
30960 __tmp.put_f32_le(self.yaw);
30961 __tmp.put_f32_le(self.thrust);
30962 __tmp.put_u8(self.mode_switch);
30963 __tmp.put_u8(self.manual_override_switch);
30964 if matches!(version, MavlinkVersion::V2) {
30965 let len = __tmp.len();
30966 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30967 } else {
30968 __tmp.len()
30969 }
30970 }
30971}
30972#[doc = "id: 23"]
30973#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
30974#[derive(Debug, Clone, PartialEq)]
30975#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30976#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30977pub struct PARAM_SET_DATA {
30978 #[doc = "Onboard parameter value"]
30979 pub param_value: f32,
30980 #[doc = "System ID"]
30981 pub target_system: u8,
30982 #[doc = "Component ID"]
30983 pub target_component: u8,
30984 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
30985 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30986 pub param_id: [u8; 16],
30987 #[doc = "Onboard parameter type."]
30988 pub param_type: MavParamType,
30989}
30990impl PARAM_SET_DATA {
30991 pub const ENCODED_LEN: usize = 23usize;
30992 pub const DEFAULT: Self = Self {
30993 param_value: 0.0_f32,
30994 target_system: 0_u8,
30995 target_component: 0_u8,
30996 param_id: [0_u8; 16usize],
30997 param_type: MavParamType::DEFAULT,
30998 };
30999 #[cfg(feature = "arbitrary")]
31000 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31001 use arbitrary::{Arbitrary, Unstructured};
31002 let mut buf = [0u8; 1024];
31003 rng.fill_bytes(&mut buf);
31004 let mut unstructured = Unstructured::new(&buf);
31005 Self::arbitrary(&mut unstructured).unwrap_or_default()
31006 }
31007}
31008impl Default for PARAM_SET_DATA {
31009 fn default() -> Self {
31010 Self::DEFAULT.clone()
31011 }
31012}
31013impl MessageData for PARAM_SET_DATA {
31014 type Message = MavMessage;
31015 const ID: u32 = 23u32;
31016 const NAME: &'static str = "PARAM_SET";
31017 const EXTRA_CRC: u8 = 168u8;
31018 const ENCODED_LEN: usize = 23usize;
31019 fn deser(
31020 _version: MavlinkVersion,
31021 __input: &[u8],
31022 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31023 let avail_len = __input.len();
31024 let mut payload_buf = [0; Self::ENCODED_LEN];
31025 let mut buf = if avail_len < Self::ENCODED_LEN {
31026 payload_buf[0..avail_len].copy_from_slice(__input);
31027 Bytes::new(&payload_buf)
31028 } else {
31029 Bytes::new(__input)
31030 };
31031 let mut __struct = Self::default();
31032 __struct.param_value = buf.get_f32_le();
31033 __struct.target_system = buf.get_u8();
31034 __struct.target_component = buf.get_u8();
31035 for v in &mut __struct.param_id {
31036 let val = buf.get_u8();
31037 *v = val;
31038 }
31039 let tmp = buf.get_u8();
31040 __struct.param_type =
31041 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31042 enum_type: "MavParamType",
31043 value: tmp as u32,
31044 })?;
31045 Ok(__struct)
31046 }
31047 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31048 let mut __tmp = BytesMut::new(bytes);
31049 #[allow(clippy::absurd_extreme_comparisons)]
31050 #[allow(unused_comparisons)]
31051 if __tmp.remaining() < Self::ENCODED_LEN {
31052 panic!(
31053 "buffer is too small (need {} bytes, but got {})",
31054 Self::ENCODED_LEN,
31055 __tmp.remaining(),
31056 )
31057 }
31058 __tmp.put_f32_le(self.param_value);
31059 __tmp.put_u8(self.target_system);
31060 __tmp.put_u8(self.target_component);
31061 for val in &self.param_id {
31062 __tmp.put_u8(*val);
31063 }
31064 __tmp.put_u8(self.param_type as u8);
31065 if matches!(version, MavlinkVersion::V2) {
31066 let len = __tmp.len();
31067 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31068 } else {
31069 __tmp.len()
31070 }
31071 }
31072}
31073#[doc = "id: 333"]
31074#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
31075#[derive(Debug, Clone, PartialEq)]
31076#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31077#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31078pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
31079 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31080 pub time_usec: u64,
31081 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
31082 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31083 pub pos_x: [f32; 5],
31084 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
31085 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31086 pub pos_y: [f32; 5],
31087 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
31088 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31089 pub pos_z: [f32; 5],
31090 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
31091 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31092 pub delta: [f32; 5],
31093 #[doc = "Yaw. Set to NaN for unchanged"]
31094 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31095 pub pos_yaw: [f32; 5],
31096 #[doc = "Number of valid control points (up-to 5 points are possible)"]
31097 pub valid_points: u8,
31098}
31099impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
31100 pub const ENCODED_LEN: usize = 109usize;
31101 pub const DEFAULT: Self = Self {
31102 time_usec: 0_u64,
31103 pos_x: [0.0_f32; 5usize],
31104 pos_y: [0.0_f32; 5usize],
31105 pos_z: [0.0_f32; 5usize],
31106 delta: [0.0_f32; 5usize],
31107 pos_yaw: [0.0_f32; 5usize],
31108 valid_points: 0_u8,
31109 };
31110 #[cfg(feature = "arbitrary")]
31111 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31112 use arbitrary::{Arbitrary, Unstructured};
31113 let mut buf = [0u8; 1024];
31114 rng.fill_bytes(&mut buf);
31115 let mut unstructured = Unstructured::new(&buf);
31116 Self::arbitrary(&mut unstructured).unwrap_or_default()
31117 }
31118}
31119impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
31120 fn default() -> Self {
31121 Self::DEFAULT.clone()
31122 }
31123}
31124impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
31125 type Message = MavMessage;
31126 const ID: u32 = 333u32;
31127 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
31128 const EXTRA_CRC: u8 = 231u8;
31129 const ENCODED_LEN: usize = 109usize;
31130 fn deser(
31131 _version: MavlinkVersion,
31132 __input: &[u8],
31133 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31134 let avail_len = __input.len();
31135 let mut payload_buf = [0; Self::ENCODED_LEN];
31136 let mut buf = if avail_len < Self::ENCODED_LEN {
31137 payload_buf[0..avail_len].copy_from_slice(__input);
31138 Bytes::new(&payload_buf)
31139 } else {
31140 Bytes::new(__input)
31141 };
31142 let mut __struct = Self::default();
31143 __struct.time_usec = buf.get_u64_le();
31144 for v in &mut __struct.pos_x {
31145 let val = buf.get_f32_le();
31146 *v = val;
31147 }
31148 for v in &mut __struct.pos_y {
31149 let val = buf.get_f32_le();
31150 *v = val;
31151 }
31152 for v in &mut __struct.pos_z {
31153 let val = buf.get_f32_le();
31154 *v = val;
31155 }
31156 for v in &mut __struct.delta {
31157 let val = buf.get_f32_le();
31158 *v = val;
31159 }
31160 for v in &mut __struct.pos_yaw {
31161 let val = buf.get_f32_le();
31162 *v = val;
31163 }
31164 __struct.valid_points = buf.get_u8();
31165 Ok(__struct)
31166 }
31167 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31168 let mut __tmp = BytesMut::new(bytes);
31169 #[allow(clippy::absurd_extreme_comparisons)]
31170 #[allow(unused_comparisons)]
31171 if __tmp.remaining() < Self::ENCODED_LEN {
31172 panic!(
31173 "buffer is too small (need {} bytes, but got {})",
31174 Self::ENCODED_LEN,
31175 __tmp.remaining(),
31176 )
31177 }
31178 __tmp.put_u64_le(self.time_usec);
31179 for val in &self.pos_x {
31180 __tmp.put_f32_le(*val);
31181 }
31182 for val in &self.pos_y {
31183 __tmp.put_f32_le(*val);
31184 }
31185 for val in &self.pos_z {
31186 __tmp.put_f32_le(*val);
31187 }
31188 for val in &self.delta {
31189 __tmp.put_f32_le(*val);
31190 }
31191 for val in &self.pos_yaw {
31192 __tmp.put_f32_le(*val);
31193 }
31194 __tmp.put_u8(self.valid_points);
31195 if matches!(version, MavlinkVersion::V2) {
31196 let len = __tmp.len();
31197 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31198 } else {
31199 __tmp.len()
31200 }
31201 }
31202}
31203#[doc = "id: 101"]
31204#[doc = "Global position/attitude estimate from a vision source."]
31205#[derive(Debug, Clone, PartialEq)]
31206#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31207#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31208pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
31209 #[doc = "Timestamp (UNIX time or since system boot)"]
31210 pub usec: u64,
31211 #[doc = "Global X position"]
31212 pub x: f32,
31213 #[doc = "Global Y position"]
31214 pub y: f32,
31215 #[doc = "Global Z position"]
31216 pub z: f32,
31217 #[doc = "Roll angle"]
31218 pub roll: f32,
31219 #[doc = "Pitch angle"]
31220 pub pitch: f32,
31221 #[doc = "Yaw angle"]
31222 pub yaw: f32,
31223 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31224 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31225 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31226 pub covariance: [f32; 21],
31227 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31228 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31229 pub reset_counter: u8,
31230}
31231impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
31232 pub const ENCODED_LEN: usize = 117usize;
31233 pub const DEFAULT: Self = Self {
31234 usec: 0_u64,
31235 x: 0.0_f32,
31236 y: 0.0_f32,
31237 z: 0.0_f32,
31238 roll: 0.0_f32,
31239 pitch: 0.0_f32,
31240 yaw: 0.0_f32,
31241 covariance: [0.0_f32; 21usize],
31242 reset_counter: 0_u8,
31243 };
31244 #[cfg(feature = "arbitrary")]
31245 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31246 use arbitrary::{Arbitrary, Unstructured};
31247 let mut buf = [0u8; 1024];
31248 rng.fill_bytes(&mut buf);
31249 let mut unstructured = Unstructured::new(&buf);
31250 Self::arbitrary(&mut unstructured).unwrap_or_default()
31251 }
31252}
31253impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
31254 fn default() -> Self {
31255 Self::DEFAULT.clone()
31256 }
31257}
31258impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
31259 type Message = MavMessage;
31260 const ID: u32 = 101u32;
31261 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
31262 const EXTRA_CRC: u8 = 102u8;
31263 const ENCODED_LEN: usize = 117usize;
31264 fn deser(
31265 _version: MavlinkVersion,
31266 __input: &[u8],
31267 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31268 let avail_len = __input.len();
31269 let mut payload_buf = [0; Self::ENCODED_LEN];
31270 let mut buf = if avail_len < Self::ENCODED_LEN {
31271 payload_buf[0..avail_len].copy_from_slice(__input);
31272 Bytes::new(&payload_buf)
31273 } else {
31274 Bytes::new(__input)
31275 };
31276 let mut __struct = Self::default();
31277 __struct.usec = buf.get_u64_le();
31278 __struct.x = buf.get_f32_le();
31279 __struct.y = buf.get_f32_le();
31280 __struct.z = buf.get_f32_le();
31281 __struct.roll = buf.get_f32_le();
31282 __struct.pitch = buf.get_f32_le();
31283 __struct.yaw = buf.get_f32_le();
31284 for v in &mut __struct.covariance {
31285 let val = buf.get_f32_le();
31286 *v = val;
31287 }
31288 __struct.reset_counter = buf.get_u8();
31289 Ok(__struct)
31290 }
31291 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31292 let mut __tmp = BytesMut::new(bytes);
31293 #[allow(clippy::absurd_extreme_comparisons)]
31294 #[allow(unused_comparisons)]
31295 if __tmp.remaining() < Self::ENCODED_LEN {
31296 panic!(
31297 "buffer is too small (need {} bytes, but got {})",
31298 Self::ENCODED_LEN,
31299 __tmp.remaining(),
31300 )
31301 }
31302 __tmp.put_u64_le(self.usec);
31303 __tmp.put_f32_le(self.x);
31304 __tmp.put_f32_le(self.y);
31305 __tmp.put_f32_le(self.z);
31306 __tmp.put_f32_le(self.roll);
31307 __tmp.put_f32_le(self.pitch);
31308 __tmp.put_f32_le(self.yaw);
31309 for val in &self.covariance {
31310 __tmp.put_f32_le(*val);
31311 }
31312 __tmp.put_u8(self.reset_counter);
31313 if matches!(version, MavlinkVersion::V2) {
31314 let len = __tmp.len();
31315 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31316 } else {
31317 __tmp.len()
31318 }
31319 }
31320}
31321#[doc = "id: 436"]
31322#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
31323#[derive(Debug, Clone, PartialEq)]
31324#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31325#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31326pub struct CURRENT_MODE_DATA {
31327 #[doc = "A bitfield for use for autopilot-specific flags"]
31328 pub custom_mode: u32,
31329 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
31330 pub intended_custom_mode: u32,
31331 #[doc = "Standard mode."]
31332 pub standard_mode: MavStandardMode,
31333}
31334impl CURRENT_MODE_DATA {
31335 pub const ENCODED_LEN: usize = 9usize;
31336 pub const DEFAULT: Self = Self {
31337 custom_mode: 0_u32,
31338 intended_custom_mode: 0_u32,
31339 standard_mode: MavStandardMode::DEFAULT,
31340 };
31341 #[cfg(feature = "arbitrary")]
31342 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31343 use arbitrary::{Arbitrary, Unstructured};
31344 let mut buf = [0u8; 1024];
31345 rng.fill_bytes(&mut buf);
31346 let mut unstructured = Unstructured::new(&buf);
31347 Self::arbitrary(&mut unstructured).unwrap_or_default()
31348 }
31349}
31350impl Default for CURRENT_MODE_DATA {
31351 fn default() -> Self {
31352 Self::DEFAULT.clone()
31353 }
31354}
31355impl MessageData for CURRENT_MODE_DATA {
31356 type Message = MavMessage;
31357 const ID: u32 = 436u32;
31358 const NAME: &'static str = "CURRENT_MODE";
31359 const EXTRA_CRC: u8 = 193u8;
31360 const ENCODED_LEN: usize = 9usize;
31361 fn deser(
31362 _version: MavlinkVersion,
31363 __input: &[u8],
31364 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31365 let avail_len = __input.len();
31366 let mut payload_buf = [0; Self::ENCODED_LEN];
31367 let mut buf = if avail_len < Self::ENCODED_LEN {
31368 payload_buf[0..avail_len].copy_from_slice(__input);
31369 Bytes::new(&payload_buf)
31370 } else {
31371 Bytes::new(__input)
31372 };
31373 let mut __struct = Self::default();
31374 __struct.custom_mode = buf.get_u32_le();
31375 __struct.intended_custom_mode = buf.get_u32_le();
31376 let tmp = buf.get_u8();
31377 __struct.standard_mode =
31378 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31379 enum_type: "MavStandardMode",
31380 value: tmp as u32,
31381 })?;
31382 Ok(__struct)
31383 }
31384 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31385 let mut __tmp = BytesMut::new(bytes);
31386 #[allow(clippy::absurd_extreme_comparisons)]
31387 #[allow(unused_comparisons)]
31388 if __tmp.remaining() < Self::ENCODED_LEN {
31389 panic!(
31390 "buffer is too small (need {} bytes, but got {})",
31391 Self::ENCODED_LEN,
31392 __tmp.remaining(),
31393 )
31394 }
31395 __tmp.put_u32_le(self.custom_mode);
31396 __tmp.put_u32_le(self.intended_custom_mode);
31397 __tmp.put_u8(self.standard_mode as u8);
31398 if matches!(version, MavlinkVersion::V2) {
31399 let len = __tmp.len();
31400 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31401 } else {
31402 __tmp.len()
31403 }
31404 }
31405}
31406#[derive(Clone, PartialEq, Debug)]
31407#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31408#[cfg_attr(feature = "serde", serde(tag = "type"))]
31409#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31410#[repr(u32)]
31411pub enum MavMessage {
31412 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
31413 MISSION_COUNT(MISSION_COUNT_DATA),
31414 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
31415 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
31416 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
31417 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
31418 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
31419 RC_CHANNELS(RC_CHANNELS_DATA),
31420 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
31421 AUTH_KEY(AUTH_KEY_DATA),
31422 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
31423 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
31424 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
31425 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
31426 LOG_DATA(LOG_DATA_DATA),
31427 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
31428 DEBUG(DEBUG_DATA),
31429 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
31430 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
31431 EFI_STATUS(EFI_STATUS_DATA),
31432 COMMAND_ACK(COMMAND_ACK_DATA),
31433 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
31434 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
31435 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
31436 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
31437 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
31438 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
31439 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
31440 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
31441 HEARTBEAT(HEARTBEAT_DATA),
31442 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
31443 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
31444 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
31445 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
31446 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
31447 EVENT(EVENT_DATA),
31448 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
31449 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
31450 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
31451 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
31452 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
31453 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
31454 STATUSTEXT(STATUSTEXT_DATA),
31455 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
31456 PLAY_TUNE(PLAY_TUNE_DATA),
31457 MEMORY_VECT(MEMORY_VECT_DATA),
31458 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
31459 FENCE_STATUS(FENCE_STATUS_DATA),
31460 GPS_STATUS(GPS_STATUS_DATA),
31461 SCALED_IMU(SCALED_IMU_DATA),
31462 LOGGING_DATA(LOGGING_DATA_DATA),
31463 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
31464 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
31465 RAW_PRESSURE(RAW_PRESSURE_DATA),
31466 COMMAND_LONG(COMMAND_LONG_DATA),
31467 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
31468 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
31469 RAW_IMU(RAW_IMU_DATA),
31470 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
31471 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
31472 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
31473 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
31474 VFR_HUD(VFR_HUD_DATA),
31475 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
31476 WINCH_STATUS(WINCH_STATUS_DATA),
31477 ESC_INFO(ESC_INFO_DATA),
31478 AVSS_PRS_SYS_STATUS(AVSS_PRS_SYS_STATUS_DATA),
31479 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
31480 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
31481 RAW_RPM(RAW_RPM_DATA),
31482 MISSION_ITEM(MISSION_ITEM_DATA),
31483 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
31484 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
31485 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
31486 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
31487 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
31488 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
31489 ODOMETRY(ODOMETRY_DATA),
31490 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
31491 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
31492 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
31493 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
31494 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
31495 WIND_COV(WIND_COV_DATA),
31496 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
31497 LANDING_TARGET(LANDING_TARGET_DATA),
31498 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
31499 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
31500 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
31501 AIS_VESSEL(AIS_VESSEL_DATA),
31502 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
31503 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
31504 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
31505 HIGHRES_IMU(HIGHRES_IMU_DATA),
31506 AVSS_DRONE_POSITION(AVSS_DRONE_POSITION_DATA),
31507 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
31508 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
31509 V2_EXTENSION(V2_EXTENSION_DATA),
31510 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
31511 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
31512 HOME_POSITION(HOME_POSITION_DATA),
31513 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
31514 HIL_CONTROLS(HIL_CONTROLS_DATA),
31515 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
31516 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
31517 AVSS_DRONE_IMU(AVSS_DRONE_IMU_DATA),
31518 BATTERY_INFO(BATTERY_INFO_DATA),
31519 SET_MODE(SET_MODE_DATA),
31520 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
31521 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
31522 GPS2_RAW(GPS2_RAW_DATA),
31523 SYSTEM_TIME(SYSTEM_TIME_DATA),
31524 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
31525 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
31526 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
31527 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
31528 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
31529 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
31530 LOGGING_ACK(LOGGING_ACK_DATA),
31531 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
31532 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
31533 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
31534 HIL_GPS(HIL_GPS_DATA),
31535 ALTITUDE(ALTITUDE_DATA),
31536 AVSS_DRONE_OPERATION_MODE(AVSS_DRONE_OPERATION_MODE_DATA),
31537 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
31538 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
31539 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
31540 PING(PING_DATA),
31541 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
31542 HIL_STATE(HIL_STATE_DATA),
31543 CAN_FRAME(CAN_FRAME_DATA),
31544 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
31545 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
31546 PARAM_VALUE(PARAM_VALUE_DATA),
31547 COLLISION(COLLISION_DATA),
31548 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
31549 DEBUG_VECT(DEBUG_VECT_DATA),
31550 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
31551 GPS_INPUT(GPS_INPUT_DATA),
31552 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
31553 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
31554 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
31555 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
31556 MISSION_CURRENT(MISSION_CURRENT_DATA),
31557 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
31558 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
31559 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
31560 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
31561 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
31562 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
31563 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
31564 GPS2_RTK(GPS2_RTK_DATA),
31565 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
31566 GPS_RAW_INT(GPS_RAW_INT_DATA),
31567 TIMESYNC(TIMESYNC_DATA),
31568 SETUP_SIGNING(SETUP_SIGNING_DATA),
31569 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
31570 CANFD_FRAME(CANFD_FRAME_DATA),
31571 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
31572 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
31573 REQUEST_EVENT(REQUEST_EVENT_DATA),
31574 MISSION_ACK(MISSION_ACK_DATA),
31575 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
31576 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
31577 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
31578 HIL_SENSOR(HIL_SENSOR_DATA),
31579 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
31580 ESC_STATUS(ESC_STATUS_DATA),
31581 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
31582 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
31583 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
31584 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
31585 LOG_ENTRY(LOG_ENTRY_DATA),
31586 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
31587 GPS_RTK(GPS_RTK_DATA),
31588 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
31589 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
31590 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
31591 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
31592 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
31593 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
31594 ATTITUDE(ATTITUDE_DATA),
31595 COMMAND_INT(COMMAND_INT_DATA),
31596 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
31597 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
31598 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
31599 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
31600 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
31601 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
31602 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
31603 SIM_STATE(SIM_STATE_DATA),
31604 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
31605 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
31606 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
31607 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
31608 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
31609 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
31610 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
31611 HIGH_LATENCY(HIGH_LATENCY_DATA),
31612 MISSION_REQUEST(MISSION_REQUEST_DATA),
31613 LOG_ERASE(LOG_ERASE_DATA),
31614 TUNNEL(TUNNEL_DATA),
31615 BATTERY_STATUS(BATTERY_STATUS_DATA),
31616 SYS_STATUS(SYS_STATUS_DATA),
31617 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
31618 VIBRATION(VIBRATION_DATA),
31619 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
31620 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
31621 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
31622 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
31623 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
31624 DATA_STREAM(DATA_STREAM_DATA),
31625 TERRAIN_DATA(TERRAIN_DATA_DATA),
31626 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
31627 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
31628 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
31629 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
31630 RADIO_STATUS(RADIO_STATUS_DATA),
31631 SCALED_IMU2(SCALED_IMU2_DATA),
31632 FUEL_STATUS(FUEL_STATUS_DATA),
31633 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
31634 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
31635 POWER_STATUS(POWER_STATUS_DATA),
31636 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
31637 SCALED_IMU3(SCALED_IMU3_DATA),
31638 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
31639 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
31640 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
31641 PARAM_SET(PARAM_SET_DATA),
31642 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
31643 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
31644 CURRENT_MODE(CURRENT_MODE_DATA),
31645}
31646impl MavMessage {
31647 pub const fn all_ids() -> &'static [u32] {
31648 &[
31649 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
31650 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
31651 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
31652 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
31653 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
31654 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
31655 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
31656 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
31657 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
31658 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
31659 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
31660 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
31661 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
31662 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
31663 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
31664 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32, 330u32,
31665 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 360u32, 370u32,
31666 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32, 390u32, 395u32,
31667 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32, 436u32, 437u32,
31668 440u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32,
31669 12915u32, 12918u32, 12919u32, 12920u32, 60050u32, 60051u32, 60052u32, 60053u32,
31670 ]
31671 }
31672}
31673impl Message for MavMessage {
31674 fn parse(
31675 version: MavlinkVersion,
31676 id: u32,
31677 payload: &[u8],
31678 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31679 match id {
31680 VISION_POSITION_ESTIMATE_DATA::ID => {
31681 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
31682 .map(Self::VISION_POSITION_ESTIMATE)
31683 }
31684 MISSION_COUNT_DATA::ID => {
31685 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
31686 }
31687 OPTICAL_FLOW_RAD_DATA::ID => {
31688 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
31689 }
31690 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
31691 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
31692 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
31693 }
31694 UAVCAN_NODE_INFO_DATA::ID => {
31695 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
31696 }
31697 SCALED_PRESSURE_DATA::ID => {
31698 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
31699 }
31700 HIL_ACTUATOR_CONTROLS_DATA::ID => {
31701 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
31702 }
31703 RC_CHANNELS_DATA::ID => {
31704 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
31705 }
31706 GPS_GLOBAL_ORIGIN_DATA::ID => {
31707 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
31708 }
31709 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
31710 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
31711 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
31712 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
31713 }
31714 ONBOARD_COMPUTER_STATUS_DATA::ID => {
31715 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
31716 .map(Self::ONBOARD_COMPUTER_STATUS)
31717 }
31718 ATTITUDE_QUATERNION_COV_DATA::ID => {
31719 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
31720 .map(Self::ATTITUDE_QUATERNION_COV)
31721 }
31722 MISSION_CLEAR_ALL_DATA::ID => {
31723 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
31724 }
31725 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
31726 BUTTON_CHANGE_DATA::ID => {
31727 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
31728 }
31729 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
31730 TERRAIN_REPORT_DATA::ID => {
31731 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
31732 }
31733 CHANGE_OPERATOR_CONTROL_DATA::ID => {
31734 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
31735 .map(Self::CHANGE_OPERATOR_CONTROL)
31736 }
31737 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
31738 COMMAND_ACK_DATA::ID => {
31739 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
31740 }
31741 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
31742 .map(Self::PARAM_EXT_REQUEST_LIST),
31743 MISSION_ITEM_REACHED_DATA::ID => {
31744 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
31745 }
31746 DISTANCE_SENSOR_DATA::ID => {
31747 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
31748 }
31749 HYGROMETER_SENSOR_DATA::ID => {
31750 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
31751 }
31752 AVAILABLE_MODES_DATA::ID => {
31753 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
31754 }
31755 CAMERA_INFORMATION_DATA::ID => {
31756 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
31757 }
31758 ACTUATOR_CONTROL_TARGET_DATA::ID => {
31759 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
31760 .map(Self::ACTUATOR_CONTROL_TARGET)
31761 }
31762 SCALED_PRESSURE3_DATA::ID => {
31763 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
31764 }
31765 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
31766 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
31767 .map(Self::LOCAL_POSITION_NED_COV),
31768 ADSB_VEHICLE_DATA::ID => {
31769 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
31770 }
31771 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
31772 .map(Self::ORBIT_EXECUTION_STATUS),
31773 MISSION_ITEM_INT_DATA::ID => {
31774 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
31775 }
31776 TERRAIN_CHECK_DATA::ID => {
31777 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
31778 }
31779 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
31780 ATTITUDE_TARGET_DATA::ID => {
31781 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
31782 }
31783 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
31784 .map(Self::ACTUATOR_OUTPUT_STATUS),
31785 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
31786 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
31787 .map(Self::SAFETY_SET_ALLOWED_AREA)
31788 }
31789 FOLLOW_TARGET_DATA::ID => {
31790 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
31791 }
31792 NAMED_VALUE_FLOAT_DATA::ID => {
31793 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
31794 }
31795 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
31796 .map(Self::OPEN_DRONE_ID_LOCATION),
31797 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
31798 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
31799 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
31800 }
31801 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
31802 MEMORY_VECT_DATA::ID => {
31803 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
31804 }
31805 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
31806 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
31807 .map(Self::TIME_ESTIMATE_TO_TARGET)
31808 }
31809 FENCE_STATUS_DATA::ID => {
31810 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
31811 }
31812 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
31813 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
31814 LOGGING_DATA_DATA::ID => {
31815 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
31816 }
31817 GPS_RTCM_DATA_DATA::ID => {
31818 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
31819 }
31820 GLOBAL_POSITION_INT_COV_DATA::ID => {
31821 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
31822 .map(Self::GLOBAL_POSITION_INT_COV)
31823 }
31824 RAW_PRESSURE_DATA::ID => {
31825 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
31826 }
31827 COMMAND_LONG_DATA::ID => {
31828 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
31829 }
31830 AUTOPILOT_VERSION_DATA::ID => {
31831 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
31832 }
31833 CELLULAR_CONFIG_DATA::ID => {
31834 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
31835 }
31836 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
31837 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
31838 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
31839 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
31840 }
31841 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
31842 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
31843 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
31844 }
31845 LOG_REQUEST_END_DATA::ID => {
31846 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
31847 }
31848 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
31849 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
31850 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
31851 }
31852 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
31853 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
31854 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
31855 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
31856 }
31857 WINCH_STATUS_DATA::ID => {
31858 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
31859 }
31860 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
31861 AVSS_PRS_SYS_STATUS_DATA::ID => {
31862 AVSS_PRS_SYS_STATUS_DATA::deser(version, payload).map(Self::AVSS_PRS_SYS_STATUS)
31863 }
31864 POSITION_TARGET_LOCAL_NED_DATA::ID => {
31865 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
31866 .map(Self::POSITION_TARGET_LOCAL_NED)
31867 }
31868 RC_CHANNELS_SCALED_DATA::ID => {
31869 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
31870 }
31871 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
31872 MISSION_ITEM_DATA::ID => {
31873 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
31874 }
31875 MISSION_REQUEST_INT_DATA::ID => {
31876 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
31877 }
31878 TERRAIN_REQUEST_DATA::ID => {
31879 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
31880 }
31881 WHEEL_DISTANCE_DATA::ID => {
31882 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
31883 }
31884 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
31885 .map(Self::CURRENT_EVENT_SEQUENCE),
31886 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
31887 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
31888 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
31889 }
31890 PARAM_EXT_ACK_DATA::ID => {
31891 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
31892 }
31893 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
31894 SERVO_OUTPUT_RAW_DATA::ID => {
31895 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
31896 }
31897 REQUEST_DATA_STREAM_DATA::ID => {
31898 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
31899 }
31900 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
31901 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
31902 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
31903 }
31904 UTM_GLOBAL_POSITION_DATA::ID => {
31905 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
31906 }
31907 MISSION_SET_CURRENT_DATA::ID => {
31908 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
31909 }
31910 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
31911 PARAM_REQUEST_LIST_DATA::ID => {
31912 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
31913 }
31914 LANDING_TARGET_DATA::ID => {
31915 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
31916 }
31917 ISBD_LINK_STATUS_DATA::ID => {
31918 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
31919 }
31920 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
31921 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
31922 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
31923 }
31924 CAMERA_IMAGE_CAPTURED_DATA::ID => {
31925 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
31926 }
31927 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
31928 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
31929 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
31930 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
31931 }
31932 GIMBAL_MANAGER_STATUS_DATA::ID => {
31933 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
31934 }
31935 PLAY_TUNE_V2_DATA::ID => {
31936 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
31937 }
31938 HIGHRES_IMU_DATA::ID => {
31939 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
31940 }
31941 AVSS_DRONE_POSITION_DATA::ID => {
31942 AVSS_DRONE_POSITION_DATA::deser(version, payload).map(Self::AVSS_DRONE_POSITION)
31943 }
31944 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
31945 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
31946 .map(Self::MISSION_WRITE_PARTIAL_LIST)
31947 }
31948 STORAGE_INFORMATION_DATA::ID => {
31949 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
31950 }
31951 V2_EXTENSION_DATA::ID => {
31952 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
31953 }
31954 MANUAL_CONTROL_DATA::ID => {
31955 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
31956 }
31957 ESTIMATOR_STATUS_DATA::ID => {
31958 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
31959 }
31960 HOME_POSITION_DATA::ID => {
31961 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
31962 }
31963 SMART_BATTERY_INFO_DATA::ID => {
31964 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
31965 }
31966 HIL_CONTROLS_DATA::ID => {
31967 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
31968 }
31969 SCALED_PRESSURE2_DATA::ID => {
31970 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
31971 }
31972 CELLULAR_STATUS_DATA::ID => {
31973 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
31974 }
31975 AVSS_DRONE_IMU_DATA::ID => {
31976 AVSS_DRONE_IMU_DATA::deser(version, payload).map(Self::AVSS_DRONE_IMU)
31977 }
31978 BATTERY_INFO_DATA::ID => {
31979 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
31980 }
31981 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
31982 VIDEO_STREAM_STATUS_DATA::ID => {
31983 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
31984 }
31985 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
31986 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
31987 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
31988 }
31989 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
31990 SYSTEM_TIME_DATA::ID => {
31991 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
31992 }
31993 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
31994 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
31995 .map(Self::POSITION_TARGET_GLOBAL_INT)
31996 }
31997 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
31998 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
31999 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
32000 }
32001 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
32002 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
32003 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
32004 }
32005 ILLUMINATOR_STATUS_DATA::ID => {
32006 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
32007 }
32008 CAMERA_THERMAL_RANGE_DATA::ID => {
32009 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
32010 }
32011 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
32012 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
32013 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
32014 }
32015 LOGGING_ACK_DATA::ID => {
32016 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
32017 }
32018 CAMERA_FOV_STATUS_DATA::ID => {
32019 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
32020 }
32021 RESPONSE_EVENT_ERROR_DATA::ID => {
32022 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
32023 }
32024 AVAILABLE_MODES_MONITOR_DATA::ID => {
32025 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
32026 .map(Self::AVAILABLE_MODES_MONITOR)
32027 }
32028 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
32029 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
32030 AVSS_DRONE_OPERATION_MODE_DATA::ID => {
32031 AVSS_DRONE_OPERATION_MODE_DATA::deser(version, payload)
32032 .map(Self::AVSS_DRONE_OPERATION_MODE)
32033 }
32034 CAMERA_TRIGGER_DATA::ID => {
32035 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
32036 }
32037 GLOBAL_POSITION_INT_DATA::ID => {
32038 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
32039 }
32040 PARAM_EXT_VALUE_DATA::ID => {
32041 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
32042 }
32043 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
32044 MOUNT_ORIENTATION_DATA::ID => {
32045 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
32046 }
32047 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
32048 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
32049 GENERATOR_STATUS_DATA::ID => {
32050 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
32051 }
32052 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
32053 .map(Self::PARAM_EXT_REQUEST_READ),
32054 PARAM_VALUE_DATA::ID => {
32055 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
32056 }
32057 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
32058 SAFETY_ALLOWED_AREA_DATA::ID => {
32059 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
32060 }
32061 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
32062 RC_CHANNELS_OVERRIDE_DATA::ID => {
32063 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
32064 }
32065 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
32066 SERIAL_CONTROL_DATA::ID => {
32067 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
32068 }
32069 OPTICAL_FLOW_DATA::ID => {
32070 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
32071 }
32072 UAVCAN_NODE_STATUS_DATA::ID => {
32073 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
32074 }
32075 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
32076 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
32077 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
32078 }
32079 MISSION_CURRENT_DATA::ID => {
32080 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
32081 }
32082 EXTENDED_SYS_STATE_DATA::ID => {
32083 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
32084 }
32085 LOG_REQUEST_DATA_DATA::ID => {
32086 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
32087 }
32088 MESSAGE_INTERVAL_DATA::ID => {
32089 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
32090 }
32091 CAN_FILTER_MODIFY_DATA::ID => {
32092 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
32093 }
32094 COMMAND_CANCEL_DATA::ID => {
32095 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
32096 }
32097 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
32098 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
32099 .map(Self::CAMERA_TRACKING_GEO_STATUS)
32100 }
32101 GPS_INJECT_DATA_DATA::ID => {
32102 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
32103 }
32104 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
32105 COMPONENT_INFORMATION_DATA::ID => {
32106 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
32107 }
32108 GPS_RAW_INT_DATA::ID => {
32109 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
32110 }
32111 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
32112 SETUP_SIGNING_DATA::ID => {
32113 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
32114 }
32115 WIFI_CONFIG_AP_DATA::ID => {
32116 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
32117 }
32118 CANFD_FRAME_DATA::ID => {
32119 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
32120 }
32121 OBSTACLE_DISTANCE_DATA::ID => {
32122 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
32123 }
32124 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
32125 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
32126 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
32127 }
32128 REQUEST_EVENT_DATA::ID => {
32129 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
32130 }
32131 MISSION_ACK_DATA::ID => {
32132 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
32133 }
32134 HIL_STATE_QUATERNION_DATA::ID => {
32135 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
32136 }
32137 PROTOCOL_VERSION_DATA::ID => {
32138 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
32139 }
32140 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
32141 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
32142 .map(Self::GIMBAL_MANAGER_INFORMATION)
32143 }
32144 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
32145 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
32146 .map(Self::FILE_TRANSFER_PROTOCOL),
32147 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
32148 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
32149 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
32150 .map(Self::GIMBAL_DEVICE_INFORMATION)
32151 }
32152 COMPONENT_METADATA_DATA::ID => {
32153 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
32154 }
32155 CAMERA_CAPTURE_STATUS_DATA::ID => {
32156 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
32157 }
32158 SET_HOME_POSITION_DATA::ID => {
32159 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
32160 }
32161 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
32162 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
32163 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
32164 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
32165 }
32166 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
32167 VIDEO_STREAM_INFORMATION_DATA::ID => {
32168 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
32169 .map(Self::VIDEO_STREAM_INFORMATION)
32170 }
32171 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
32172 .map(Self::OPEN_DRONE_ID_BASIC_ID),
32173 COMPONENT_INFORMATION_BASIC_DATA::ID => {
32174 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
32175 .map(Self::COMPONENT_INFORMATION_BASIC)
32176 }
32177 VICON_POSITION_ESTIMATE_DATA::ID => {
32178 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
32179 .map(Self::VICON_POSITION_ESTIMATE)
32180 }
32181 PARAM_EXT_SET_DATA::ID => {
32182 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
32183 }
32184 NAV_CONTROLLER_OUTPUT_DATA::ID => {
32185 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
32186 }
32187 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
32188 COMMAND_INT_DATA::ID => {
32189 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
32190 }
32191 LOGGING_DATA_ACKED_DATA::ID => {
32192 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
32193 }
32194 SET_ATTITUDE_TARGET_DATA::ID => {
32195 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
32196 }
32197 ATTITUDE_QUATERNION_DATA::ID => {
32198 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
32199 }
32200 FLIGHT_INFORMATION_DATA::ID => {
32201 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
32202 }
32203 HIL_OPTICAL_FLOW_DATA::ID => {
32204 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
32205 }
32206 VISION_SPEED_ESTIMATE_DATA::ID => {
32207 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
32208 }
32209 HIGH_LATENCY2_DATA::ID => {
32210 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
32211 }
32212 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
32213 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
32214 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
32215 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
32216 }
32217 PARAM_MAP_RC_DATA::ID => {
32218 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
32219 }
32220 CAMERA_SETTINGS_DATA::ID => {
32221 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
32222 }
32223 MISSION_REQUEST_LIST_DATA::ID => {
32224 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
32225 }
32226 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
32227 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
32228 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
32229 }
32230 RC_CHANNELS_RAW_DATA::ID => {
32231 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
32232 }
32233 LOG_REQUEST_LIST_DATA::ID => {
32234 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
32235 }
32236 HIGH_LATENCY_DATA::ID => {
32237 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
32238 }
32239 MISSION_REQUEST_DATA::ID => {
32240 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
32241 }
32242 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
32243 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
32244 BATTERY_STATUS_DATA::ID => {
32245 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
32246 }
32247 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
32248 RESOURCE_REQUEST_DATA::ID => {
32249 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
32250 }
32251 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
32252 DEBUG_FLOAT_ARRAY_DATA::ID => {
32253 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
32254 }
32255 LINK_NODE_STATUS_DATA::ID => {
32256 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
32257 }
32258 ATT_POS_MOCAP_DATA::ID => {
32259 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
32260 }
32261 CONTROL_SYSTEM_STATE_DATA::ID => {
32262 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
32263 }
32264 LOCAL_POSITION_NED_DATA::ID => {
32265 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
32266 }
32267 DATA_STREAM_DATA::ID => {
32268 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
32269 }
32270 TERRAIN_DATA_DATA::ID => {
32271 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
32272 }
32273 ENCAPSULATED_DATA_DATA::ID => {
32274 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
32275 }
32276 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
32277 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
32278 }
32279 HIL_RC_INPUTS_RAW_DATA::ID => {
32280 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
32281 }
32282 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
32283 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
32284 }
32285 RADIO_STATUS_DATA::ID => {
32286 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
32287 }
32288 SCALED_IMU2_DATA::ID => {
32289 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
32290 }
32291 FUEL_STATUS_DATA::ID => {
32292 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
32293 }
32294 SUPPORTED_TUNES_DATA::ID => {
32295 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
32296 }
32297 MAG_CAL_REPORT_DATA::ID => {
32298 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
32299 }
32300 POWER_STATUS_DATA::ID => {
32301 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
32302 }
32303 PARAM_REQUEST_READ_DATA::ID => {
32304 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
32305 }
32306 SCALED_IMU3_DATA::ID => {
32307 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
32308 }
32309 NAMED_VALUE_INT_DATA::ID => {
32310 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
32311 }
32312 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
32313 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
32314 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
32315 }
32316 MANUAL_SETPOINT_DATA::ID => {
32317 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
32318 }
32319 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
32320 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
32321 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
32322 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
32323 }
32324 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
32325 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
32326 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
32327 }
32328 CURRENT_MODE_DATA::ID => {
32329 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
32330 }
32331 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
32332 }
32333 }
32334 fn message_name(&self) -> &'static str {
32335 match self {
32336 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
32337 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
32338 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
32339 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
32340 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
32341 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
32342 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
32343 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
32344 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
32345 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
32346 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
32347 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
32348 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
32349 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
32350 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
32351 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
32352 Self::DEBUG(..) => DEBUG_DATA::NAME,
32353 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
32354 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
32355 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
32356 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
32357 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
32358 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
32359 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
32360 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
32361 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
32362 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
32363 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
32364 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
32365 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
32366 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
32367 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
32368 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
32369 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
32370 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
32371 Self::EVENT(..) => EVENT_DATA::NAME,
32372 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
32373 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
32374 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
32375 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
32376 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
32377 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
32378 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
32379 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
32380 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
32381 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
32382 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
32383 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
32384 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
32385 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
32386 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
32387 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
32388 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
32389 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
32390 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
32391 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
32392 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
32393 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
32394 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
32395 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
32396 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
32397 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
32398 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
32399 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
32400 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
32401 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
32402 Self::AVSS_PRS_SYS_STATUS(..) => AVSS_PRS_SYS_STATUS_DATA::NAME,
32403 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
32404 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
32405 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
32406 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
32407 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
32408 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
32409 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
32410 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
32411 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
32412 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
32413 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
32414 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
32415 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
32416 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
32417 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
32418 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
32419 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
32420 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
32421 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
32422 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
32423 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
32424 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
32425 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
32426 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
32427 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
32428 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
32429 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
32430 Self::AVSS_DRONE_POSITION(..) => AVSS_DRONE_POSITION_DATA::NAME,
32431 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
32432 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
32433 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
32434 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
32435 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
32436 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
32437 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
32438 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
32439 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
32440 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
32441 Self::AVSS_DRONE_IMU(..) => AVSS_DRONE_IMU_DATA::NAME,
32442 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
32443 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
32444 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
32445 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
32446 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
32447 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
32448 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
32449 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
32450 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
32451 }
32452 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
32453 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
32454 }
32455 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
32456 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
32457 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
32458 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
32459 }
32460 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
32461 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
32462 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
32463 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
32464 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
32465 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
32466 Self::AVSS_DRONE_OPERATION_MODE(..) => AVSS_DRONE_OPERATION_MODE_DATA::NAME,
32467 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
32468 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
32469 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
32470 Self::PING(..) => PING_DATA::NAME,
32471 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
32472 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
32473 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
32474 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
32475 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
32476 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
32477 Self::COLLISION(..) => COLLISION_DATA::NAME,
32478 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
32479 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
32480 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
32481 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
32482 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
32483 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
32484 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
32485 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
32486 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
32487 }
32488 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
32489 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
32490 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
32491 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
32492 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
32493 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
32494 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
32495 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
32496 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
32497 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
32498 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
32499 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
32500 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
32501 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
32502 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
32503 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
32504 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
32505 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
32506 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
32507 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
32508 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
32509 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
32510 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
32511 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
32512 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
32513 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
32514 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
32515 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
32516 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
32517 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
32518 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
32519 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
32520 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
32521 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
32522 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
32523 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
32524 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
32525 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
32526 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
32527 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
32528 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
32529 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
32530 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
32531 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
32532 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
32533 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
32534 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
32535 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
32536 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
32537 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
32538 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
32539 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
32540 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
32541 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
32542 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
32543 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
32544 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
32545 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
32546 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
32547 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
32548 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
32549 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
32550 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
32551 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
32552 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
32553 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
32554 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
32555 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
32556 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
32557 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
32558 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
32559 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
32560 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
32561 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
32562 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
32563 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
32564 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
32565 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
32566 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
32567 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
32568 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
32569 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
32570 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
32571 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
32572 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
32573 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
32574 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
32575 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
32576 }
32577 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
32578 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
32579 }
32580 }
32581 fn message_id(&self) -> u32 {
32582 match self {
32583 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
32584 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
32585 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
32586 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
32587 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
32588 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
32589 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
32590 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
32591 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
32592 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
32593 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
32594 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
32595 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
32596 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
32597 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
32598 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
32599 Self::DEBUG(..) => DEBUG_DATA::ID,
32600 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
32601 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
32602 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
32603 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
32604 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
32605 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
32606 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
32607 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
32608 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
32609 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
32610 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
32611 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
32612 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
32613 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
32614 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
32615 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
32616 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
32617 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
32618 Self::EVENT(..) => EVENT_DATA::ID,
32619 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
32620 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
32621 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
32622 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
32623 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
32624 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
32625 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
32626 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
32627 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
32628 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
32629 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
32630 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
32631 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
32632 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
32633 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
32634 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
32635 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
32636 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
32637 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
32638 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
32639 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
32640 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
32641 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
32642 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
32643 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
32644 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
32645 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
32646 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
32647 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
32648 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
32649 Self::AVSS_PRS_SYS_STATUS(..) => AVSS_PRS_SYS_STATUS_DATA::ID,
32650 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
32651 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
32652 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
32653 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
32654 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
32655 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
32656 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
32657 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
32658 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
32659 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
32660 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
32661 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
32662 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
32663 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
32664 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
32665 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
32666 Self::WIND_COV(..) => WIND_COV_DATA::ID,
32667 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
32668 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
32669 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
32670 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
32671 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
32672 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
32673 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
32674 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
32675 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
32676 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
32677 Self::AVSS_DRONE_POSITION(..) => AVSS_DRONE_POSITION_DATA::ID,
32678 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
32679 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
32680 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
32681 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
32682 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
32683 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
32684 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
32685 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
32686 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
32687 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
32688 Self::AVSS_DRONE_IMU(..) => AVSS_DRONE_IMU_DATA::ID,
32689 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
32690 Self::SET_MODE(..) => SET_MODE_DATA::ID,
32691 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
32692 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
32693 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
32694 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
32695 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
32696 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
32697 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
32698 }
32699 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
32700 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
32701 }
32702 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
32703 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
32704 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
32705 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
32706 }
32707 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
32708 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
32709 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
32710 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
32711 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
32712 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
32713 Self::AVSS_DRONE_OPERATION_MODE(..) => AVSS_DRONE_OPERATION_MODE_DATA::ID,
32714 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
32715 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
32716 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
32717 Self::PING(..) => PING_DATA::ID,
32718 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
32719 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
32720 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
32721 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
32722 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
32723 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
32724 Self::COLLISION(..) => COLLISION_DATA::ID,
32725 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
32726 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
32727 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
32728 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
32729 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
32730 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
32731 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
32732 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
32733 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
32734 }
32735 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
32736 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
32737 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
32738 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
32739 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
32740 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
32741 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
32742 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
32743 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
32744 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
32745 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
32746 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
32747 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
32748 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
32749 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
32750 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
32751 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
32752 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
32753 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
32754 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
32755 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
32756 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
32757 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
32758 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
32759 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
32760 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
32761 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
32762 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
32763 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
32764 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
32765 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
32766 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
32767 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
32768 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
32769 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
32770 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
32771 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
32772 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
32773 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
32774 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
32775 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
32776 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
32777 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
32778 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
32779 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
32780 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
32781 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
32782 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
32783 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
32784 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
32785 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
32786 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
32787 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
32788 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
32789 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
32790 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
32791 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
32792 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
32793 Self::TUNNEL(..) => TUNNEL_DATA::ID,
32794 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
32795 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
32796 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
32797 Self::VIBRATION(..) => VIBRATION_DATA::ID,
32798 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
32799 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
32800 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
32801 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
32802 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
32803 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
32804 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
32805 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
32806 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
32807 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
32808 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
32809 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
32810 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
32811 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
32812 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
32813 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
32814 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
32815 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
32816 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
32817 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
32818 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
32819 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
32820 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
32821 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
32822 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
32823 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
32824 }
32825 }
32826 fn message_id_from_name(name: &str) -> Option<u32> {
32827 match name {
32828 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
32829 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
32830 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
32831 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
32832 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
32833 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
32834 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
32835 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
32836 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
32837 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
32838 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
32839 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
32840 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
32841 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
32842 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
32843 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
32844 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
32845 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
32846 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
32847 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
32848 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
32849 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
32850 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
32851 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
32852 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
32853 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
32854 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
32855 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
32856 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
32857 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
32858 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
32859 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
32860 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
32861 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
32862 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
32863 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
32864 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
32865 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
32866 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
32867 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
32868 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
32869 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
32870 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
32871 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
32872 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
32873 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
32874 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
32875 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
32876 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
32877 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
32878 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
32879 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
32880 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
32881 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
32882 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
32883 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
32884 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
32885 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
32886 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
32887 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
32888 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
32889 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
32890 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
32891 }
32892 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
32893 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
32894 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
32895 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
32896 AVSS_PRS_SYS_STATUS_DATA::NAME => Some(AVSS_PRS_SYS_STATUS_DATA::ID),
32897 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
32898 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
32899 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
32900 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
32901 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
32902 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
32903 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
32904 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
32905 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
32906 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
32907 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
32908 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
32909 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
32910 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
32911 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
32912 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
32913 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
32914 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
32915 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
32916 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
32917 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
32918 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
32919 }
32920 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
32921 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
32922 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
32923 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
32924 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
32925 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
32926 AVSS_DRONE_POSITION_DATA::NAME => Some(AVSS_DRONE_POSITION_DATA::ID),
32927 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
32928 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
32929 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
32930 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
32931 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
32932 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
32933 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
32934 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
32935 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
32936 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
32937 AVSS_DRONE_IMU_DATA::NAME => Some(AVSS_DRONE_IMU_DATA::ID),
32938 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
32939 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
32940 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
32941 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
32942 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
32943 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
32944 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
32945 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
32946 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
32947 }
32948 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
32949 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
32950 }
32951 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
32952 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
32953 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
32954 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
32955 }
32956 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
32957 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
32958 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
32959 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
32960 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
32961 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
32962 AVSS_DRONE_OPERATION_MODE_DATA::NAME => Some(AVSS_DRONE_OPERATION_MODE_DATA::ID),
32963 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
32964 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
32965 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
32966 PING_DATA::NAME => Some(PING_DATA::ID),
32967 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
32968 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
32969 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
32970 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
32971 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
32972 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
32973 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
32974 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
32975 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
32976 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
32977 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
32978 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
32979 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
32980 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
32981 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
32982 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
32983 }
32984 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
32985 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
32986 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
32987 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
32988 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
32989 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
32990 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
32991 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
32992 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
32993 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
32994 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
32995 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
32996 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
32997 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
32998 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
32999 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
33000 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
33001 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
33002 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
33003 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
33004 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
33005 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
33006 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
33007 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
33008 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
33009 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
33010 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
33011 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
33012 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
33013 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
33014 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
33015 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
33016 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
33017 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
33018 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
33019 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
33020 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
33021 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
33022 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
33023 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
33024 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
33025 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
33026 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
33027 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
33028 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
33029 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
33030 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
33031 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
33032 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
33033 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
33034 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
33035 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
33036 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
33037 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
33038 }
33039 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
33040 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
33041 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
33042 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
33043 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
33044 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
33045 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
33046 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
33047 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
33048 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
33049 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
33050 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
33051 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
33052 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
33053 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
33054 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
33055 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
33056 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
33057 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
33058 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
33059 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
33060 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
33061 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
33062 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
33063 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
33064 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
33065 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
33066 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
33067 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
33068 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
33069 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
33070 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
33071 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
33072 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
33073 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
33074 }
33075 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
33076 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
33077 }
33078 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
33079 _ => None,
33080 }
33081 }
33082 fn default_message_from_id(id: u32) -> Option<Self> {
33083 match id {
33084 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
33085 VISION_POSITION_ESTIMATE_DATA::default(),
33086 )),
33087 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
33088 OPTICAL_FLOW_RAD_DATA::ID => {
33089 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
33090 }
33091 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
33092 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
33093 )),
33094 UAVCAN_NODE_INFO_DATA::ID => {
33095 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
33096 }
33097 SCALED_PRESSURE_DATA::ID => {
33098 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
33099 }
33100 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
33101 HIL_ACTUATOR_CONTROLS_DATA::default(),
33102 )),
33103 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
33104 GPS_GLOBAL_ORIGIN_DATA::ID => {
33105 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
33106 }
33107 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
33108 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
33109 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
33110 )),
33111 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
33112 ONBOARD_COMPUTER_STATUS_DATA::default(),
33113 )),
33114 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
33115 ATTITUDE_QUATERNION_COV_DATA::default(),
33116 )),
33117 MISSION_CLEAR_ALL_DATA::ID => {
33118 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
33119 }
33120 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
33121 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
33122 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
33123 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
33124 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
33125 CHANGE_OPERATOR_CONTROL_DATA::default(),
33126 )),
33127 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
33128 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
33129 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
33130 PARAM_EXT_REQUEST_LIST_DATA::default(),
33131 )),
33132 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
33133 MISSION_ITEM_REACHED_DATA::default(),
33134 )),
33135 DISTANCE_SENSOR_DATA::ID => {
33136 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
33137 }
33138 HYGROMETER_SENSOR_DATA::ID => {
33139 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
33140 }
33141 AVAILABLE_MODES_DATA::ID => {
33142 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
33143 }
33144 CAMERA_INFORMATION_DATA::ID => {
33145 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
33146 }
33147 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
33148 ACTUATOR_CONTROL_TARGET_DATA::default(),
33149 )),
33150 SCALED_PRESSURE3_DATA::ID => {
33151 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
33152 }
33153 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
33154 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
33155 LOCAL_POSITION_NED_COV_DATA::default(),
33156 )),
33157 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
33158 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
33159 ORBIT_EXECUTION_STATUS_DATA::default(),
33160 )),
33161 MISSION_ITEM_INT_DATA::ID => {
33162 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
33163 }
33164 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
33165 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
33166 ATTITUDE_TARGET_DATA::ID => {
33167 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
33168 }
33169 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
33170 ACTUATOR_OUTPUT_STATUS_DATA::default(),
33171 )),
33172 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
33173 SAFETY_SET_ALLOWED_AREA_DATA::default(),
33174 )),
33175 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
33176 NAMED_VALUE_FLOAT_DATA::ID => {
33177 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
33178 }
33179 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
33180 OPEN_DRONE_ID_LOCATION_DATA::default(),
33181 )),
33182 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
33183 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
33184 OPEN_DRONE_ID_SELF_ID_DATA::default(),
33185 )),
33186 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
33187 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
33188 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
33189 TIME_ESTIMATE_TO_TARGET_DATA::default(),
33190 )),
33191 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
33192 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
33193 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
33194 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
33195 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
33196 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
33197 GLOBAL_POSITION_INT_COV_DATA::default(),
33198 )),
33199 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
33200 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
33201 AUTOPILOT_VERSION_DATA::ID => {
33202 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
33203 }
33204 CELLULAR_CONFIG_DATA::ID => {
33205 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
33206 }
33207 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
33208 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
33209 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
33210 )),
33211 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
33212 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
33213 )),
33214 LOG_REQUEST_END_DATA::ID => {
33215 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
33216 }
33217 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
33218 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
33219 )),
33220 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
33221 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
33222 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
33223 )),
33224 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
33225 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
33226 AVSS_PRS_SYS_STATUS_DATA::ID => Some(Self::AVSS_PRS_SYS_STATUS(
33227 AVSS_PRS_SYS_STATUS_DATA::default(),
33228 )),
33229 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
33230 POSITION_TARGET_LOCAL_NED_DATA::default(),
33231 )),
33232 RC_CHANNELS_SCALED_DATA::ID => {
33233 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
33234 }
33235 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
33236 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
33237 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
33238 MISSION_REQUEST_INT_DATA::default(),
33239 )),
33240 TERRAIN_REQUEST_DATA::ID => {
33241 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
33242 }
33243 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
33244 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
33245 CURRENT_EVENT_SEQUENCE_DATA::default(),
33246 )),
33247 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
33248 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
33249 )),
33250 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
33251 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
33252 SERVO_OUTPUT_RAW_DATA::ID => {
33253 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
33254 }
33255 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
33256 REQUEST_DATA_STREAM_DATA::default(),
33257 )),
33258 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
33259 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
33260 )),
33261 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
33262 UTM_GLOBAL_POSITION_DATA::default(),
33263 )),
33264 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
33265 MISSION_SET_CURRENT_DATA::default(),
33266 )),
33267 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
33268 PARAM_REQUEST_LIST_DATA::ID => {
33269 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
33270 }
33271 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
33272 ISBD_LINK_STATUS_DATA::ID => {
33273 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
33274 }
33275 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
33276 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
33277 )),
33278 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
33279 CAMERA_IMAGE_CAPTURED_DATA::default(),
33280 )),
33281 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
33282 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
33283 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
33284 )),
33285 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
33286 GIMBAL_MANAGER_STATUS_DATA::default(),
33287 )),
33288 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
33289 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
33290 AVSS_DRONE_POSITION_DATA::ID => Some(Self::AVSS_DRONE_POSITION(
33291 AVSS_DRONE_POSITION_DATA::default(),
33292 )),
33293 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
33294 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
33295 )),
33296 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
33297 STORAGE_INFORMATION_DATA::default(),
33298 )),
33299 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
33300 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
33301 ESTIMATOR_STATUS_DATA::ID => {
33302 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
33303 }
33304 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
33305 SMART_BATTERY_INFO_DATA::ID => {
33306 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
33307 }
33308 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
33309 SCALED_PRESSURE2_DATA::ID => {
33310 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
33311 }
33312 CELLULAR_STATUS_DATA::ID => {
33313 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
33314 }
33315 AVSS_DRONE_IMU_DATA::ID => Some(Self::AVSS_DRONE_IMU(AVSS_DRONE_IMU_DATA::default())),
33316 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
33317 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
33318 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
33319 VIDEO_STREAM_STATUS_DATA::default(),
33320 )),
33321 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
33322 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
33323 )),
33324 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
33325 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
33326 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
33327 POSITION_TARGET_GLOBAL_INT_DATA::default(),
33328 )),
33329 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33330 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
33331 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
33332 ))
33333 }
33334 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
33335 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
33336 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
33337 ))
33338 }
33339 ILLUMINATOR_STATUS_DATA::ID => {
33340 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
33341 }
33342 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
33343 CAMERA_THERMAL_RANGE_DATA::default(),
33344 )),
33345 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33346 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
33347 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
33348 ))
33349 }
33350 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
33351 CAMERA_FOV_STATUS_DATA::ID => {
33352 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
33353 }
33354 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
33355 RESPONSE_EVENT_ERROR_DATA::default(),
33356 )),
33357 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
33358 AVAILABLE_MODES_MONITOR_DATA::default(),
33359 )),
33360 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
33361 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
33362 AVSS_DRONE_OPERATION_MODE_DATA::ID => Some(Self::AVSS_DRONE_OPERATION_MODE(
33363 AVSS_DRONE_OPERATION_MODE_DATA::default(),
33364 )),
33365 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
33366 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
33367 GLOBAL_POSITION_INT_DATA::default(),
33368 )),
33369 PARAM_EXT_VALUE_DATA::ID => {
33370 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
33371 }
33372 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
33373 MOUNT_ORIENTATION_DATA::ID => {
33374 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
33375 }
33376 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
33377 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
33378 GENERATOR_STATUS_DATA::ID => {
33379 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
33380 }
33381 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
33382 PARAM_EXT_REQUEST_READ_DATA::default(),
33383 )),
33384 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
33385 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
33386 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
33387 SAFETY_ALLOWED_AREA_DATA::default(),
33388 )),
33389 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
33390 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
33391 RC_CHANNELS_OVERRIDE_DATA::default(),
33392 )),
33393 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
33394 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
33395 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
33396 UAVCAN_NODE_STATUS_DATA::ID => {
33397 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
33398 }
33399 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33400 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
33401 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
33402 ))
33403 }
33404 MISSION_CURRENT_DATA::ID => {
33405 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
33406 }
33407 EXTENDED_SYS_STATE_DATA::ID => {
33408 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
33409 }
33410 LOG_REQUEST_DATA_DATA::ID => {
33411 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
33412 }
33413 MESSAGE_INTERVAL_DATA::ID => {
33414 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
33415 }
33416 CAN_FILTER_MODIFY_DATA::ID => {
33417 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
33418 }
33419 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
33420 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
33421 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
33422 )),
33423 GPS_INJECT_DATA_DATA::ID => {
33424 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
33425 }
33426 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
33427 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
33428 COMPONENT_INFORMATION_DATA::default(),
33429 )),
33430 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
33431 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
33432 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
33433 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
33434 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
33435 OBSTACLE_DISTANCE_DATA::ID => {
33436 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
33437 }
33438 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
33439 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
33440 )),
33441 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
33442 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
33443 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
33444 HIL_STATE_QUATERNION_DATA::default(),
33445 )),
33446 PROTOCOL_VERSION_DATA::ID => {
33447 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
33448 }
33449 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
33450 GIMBAL_MANAGER_INFORMATION_DATA::default(),
33451 )),
33452 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
33453 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
33454 FILE_TRANSFER_PROTOCOL_DATA::default(),
33455 )),
33456 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
33457 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
33458 GIMBAL_DEVICE_INFORMATION_DATA::default(),
33459 )),
33460 COMPONENT_METADATA_DATA::ID => {
33461 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
33462 }
33463 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
33464 CAMERA_CAPTURE_STATUS_DATA::default(),
33465 )),
33466 SET_HOME_POSITION_DATA::ID => {
33467 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
33468 }
33469 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
33470 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
33471 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
33472 )),
33473 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
33474 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
33475 VIDEO_STREAM_INFORMATION_DATA::default(),
33476 )),
33477 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
33478 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
33479 )),
33480 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
33481 COMPONENT_INFORMATION_BASIC_DATA::default(),
33482 )),
33483 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
33484 VICON_POSITION_ESTIMATE_DATA::default(),
33485 )),
33486 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
33487 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
33488 NAV_CONTROLLER_OUTPUT_DATA::default(),
33489 )),
33490 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
33491 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
33492 LOGGING_DATA_ACKED_DATA::ID => {
33493 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
33494 }
33495 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
33496 SET_ATTITUDE_TARGET_DATA::default(),
33497 )),
33498 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
33499 ATTITUDE_QUATERNION_DATA::default(),
33500 )),
33501 FLIGHT_INFORMATION_DATA::ID => {
33502 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
33503 }
33504 HIL_OPTICAL_FLOW_DATA::ID => {
33505 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
33506 }
33507 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
33508 VISION_SPEED_ESTIMATE_DATA::default(),
33509 )),
33510 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
33511 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
33512 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
33513 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
33514 )),
33515 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
33516 CAMERA_SETTINGS_DATA::ID => {
33517 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
33518 }
33519 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
33520 MISSION_REQUEST_LIST_DATA::default(),
33521 )),
33522 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
33523 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
33524 )),
33525 RC_CHANNELS_RAW_DATA::ID => {
33526 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
33527 }
33528 LOG_REQUEST_LIST_DATA::ID => {
33529 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
33530 }
33531 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
33532 MISSION_REQUEST_DATA::ID => {
33533 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
33534 }
33535 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
33536 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
33537 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
33538 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
33539 RESOURCE_REQUEST_DATA::ID => {
33540 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
33541 }
33542 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
33543 DEBUG_FLOAT_ARRAY_DATA::ID => {
33544 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
33545 }
33546 LINK_NODE_STATUS_DATA::ID => {
33547 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
33548 }
33549 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
33550 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
33551 CONTROL_SYSTEM_STATE_DATA::default(),
33552 )),
33553 LOCAL_POSITION_NED_DATA::ID => {
33554 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
33555 }
33556 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
33557 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
33558 ENCAPSULATED_DATA_DATA::ID => {
33559 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
33560 }
33561 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
33562 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
33563 )),
33564 HIL_RC_INPUTS_RAW_DATA::ID => {
33565 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
33566 }
33567 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
33568 OPEN_DRONE_ID_SYSTEM_DATA::default(),
33569 )),
33570 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
33571 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
33572 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
33573 SUPPORTED_TUNES_DATA::ID => {
33574 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
33575 }
33576 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
33577 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
33578 PARAM_REQUEST_READ_DATA::ID => {
33579 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
33580 }
33581 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
33582 NAMED_VALUE_INT_DATA::ID => {
33583 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
33584 }
33585 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
33586 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
33587 )),
33588 MANUAL_SETPOINT_DATA::ID => {
33589 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
33590 }
33591 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
33592 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
33593 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
33594 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
33595 ))
33596 }
33597 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
33598 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
33599 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
33600 ))
33601 }
33602 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
33603 _ => None,
33604 }
33605 }
33606 #[cfg(feature = "arbitrary")]
33607 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
33608 match id {
33609 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
33610 VISION_POSITION_ESTIMATE_DATA::random(rng),
33611 )),
33612 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
33613 OPTICAL_FLOW_RAD_DATA::ID => {
33614 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
33615 }
33616 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
33617 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
33618 )),
33619 UAVCAN_NODE_INFO_DATA::ID => {
33620 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
33621 }
33622 SCALED_PRESSURE_DATA::ID => {
33623 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
33624 }
33625 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
33626 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
33627 )),
33628 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
33629 GPS_GLOBAL_ORIGIN_DATA::ID => {
33630 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
33631 }
33632 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
33633 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
33634 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
33635 )),
33636 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
33637 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
33638 )),
33639 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
33640 ATTITUDE_QUATERNION_COV_DATA::random(rng),
33641 )),
33642 MISSION_CLEAR_ALL_DATA::ID => {
33643 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
33644 }
33645 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
33646 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
33647 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
33648 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
33649 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
33650 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
33651 )),
33652 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
33653 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
33654 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
33655 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
33656 )),
33657 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
33658 MISSION_ITEM_REACHED_DATA::random(rng),
33659 )),
33660 DISTANCE_SENSOR_DATA::ID => {
33661 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
33662 }
33663 HYGROMETER_SENSOR_DATA::ID => {
33664 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
33665 }
33666 AVAILABLE_MODES_DATA::ID => {
33667 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
33668 }
33669 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
33670 CAMERA_INFORMATION_DATA::random(rng),
33671 )),
33672 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
33673 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
33674 )),
33675 SCALED_PRESSURE3_DATA::ID => {
33676 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
33677 }
33678 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
33679 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
33680 LOCAL_POSITION_NED_COV_DATA::random(rng),
33681 )),
33682 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
33683 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
33684 ORBIT_EXECUTION_STATUS_DATA::random(rng),
33685 )),
33686 MISSION_ITEM_INT_DATA::ID => {
33687 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
33688 }
33689 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
33690 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
33691 ATTITUDE_TARGET_DATA::ID => {
33692 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
33693 }
33694 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
33695 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
33696 )),
33697 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
33698 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
33699 )),
33700 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
33701 NAMED_VALUE_FLOAT_DATA::ID => {
33702 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
33703 }
33704 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
33705 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
33706 )),
33707 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
33708 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
33709 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
33710 )),
33711 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
33712 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
33713 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
33714 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
33715 )),
33716 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
33717 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
33718 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
33719 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
33720 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
33721 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
33722 GLOBAL_POSITION_INT_COV_DATA::random(rng),
33723 )),
33724 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
33725 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
33726 AUTOPILOT_VERSION_DATA::ID => {
33727 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
33728 }
33729 CELLULAR_CONFIG_DATA::ID => {
33730 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
33731 }
33732 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
33733 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
33734 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
33735 )),
33736 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
33737 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
33738 )),
33739 LOG_REQUEST_END_DATA::ID => {
33740 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
33741 }
33742 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
33743 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
33744 )),
33745 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
33746 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
33747 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
33748 )),
33749 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
33750 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
33751 AVSS_PRS_SYS_STATUS_DATA::ID => Some(Self::AVSS_PRS_SYS_STATUS(
33752 AVSS_PRS_SYS_STATUS_DATA::random(rng),
33753 )),
33754 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
33755 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
33756 )),
33757 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
33758 RC_CHANNELS_SCALED_DATA::random(rng),
33759 )),
33760 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
33761 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
33762 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
33763 MISSION_REQUEST_INT_DATA::random(rng),
33764 )),
33765 TERRAIN_REQUEST_DATA::ID => {
33766 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
33767 }
33768 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
33769 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
33770 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
33771 )),
33772 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
33773 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
33774 )),
33775 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
33776 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
33777 SERVO_OUTPUT_RAW_DATA::ID => {
33778 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
33779 }
33780 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
33781 REQUEST_DATA_STREAM_DATA::random(rng),
33782 )),
33783 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
33784 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
33785 )),
33786 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
33787 UTM_GLOBAL_POSITION_DATA::random(rng),
33788 )),
33789 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
33790 MISSION_SET_CURRENT_DATA::random(rng),
33791 )),
33792 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
33793 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
33794 PARAM_REQUEST_LIST_DATA::random(rng),
33795 )),
33796 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
33797 ISBD_LINK_STATUS_DATA::ID => {
33798 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
33799 }
33800 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
33801 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
33802 )),
33803 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
33804 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
33805 )),
33806 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
33807 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
33808 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
33809 )),
33810 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
33811 GIMBAL_MANAGER_STATUS_DATA::random(rng),
33812 )),
33813 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
33814 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
33815 AVSS_DRONE_POSITION_DATA::ID => Some(Self::AVSS_DRONE_POSITION(
33816 AVSS_DRONE_POSITION_DATA::random(rng),
33817 )),
33818 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
33819 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
33820 )),
33821 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
33822 STORAGE_INFORMATION_DATA::random(rng),
33823 )),
33824 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
33825 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
33826 ESTIMATOR_STATUS_DATA::ID => {
33827 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
33828 }
33829 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
33830 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
33831 SMART_BATTERY_INFO_DATA::random(rng),
33832 )),
33833 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
33834 SCALED_PRESSURE2_DATA::ID => {
33835 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
33836 }
33837 CELLULAR_STATUS_DATA::ID => {
33838 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
33839 }
33840 AVSS_DRONE_IMU_DATA::ID => Some(Self::AVSS_DRONE_IMU(AVSS_DRONE_IMU_DATA::random(rng))),
33841 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
33842 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
33843 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
33844 VIDEO_STREAM_STATUS_DATA::random(rng),
33845 )),
33846 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
33847 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
33848 )),
33849 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
33850 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
33851 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
33852 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
33853 )),
33854 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
33855 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
33856 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
33857 ))
33858 }
33859 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
33860 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
33861 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
33862 ))
33863 }
33864 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
33865 ILLUMINATOR_STATUS_DATA::random(rng),
33866 )),
33867 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
33868 CAMERA_THERMAL_RANGE_DATA::random(rng),
33869 )),
33870 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
33871 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
33872 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
33873 ))
33874 }
33875 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
33876 CAMERA_FOV_STATUS_DATA::ID => {
33877 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
33878 }
33879 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
33880 RESPONSE_EVENT_ERROR_DATA::random(rng),
33881 )),
33882 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
33883 AVAILABLE_MODES_MONITOR_DATA::random(rng),
33884 )),
33885 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
33886 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
33887 AVSS_DRONE_OPERATION_MODE_DATA::ID => Some(Self::AVSS_DRONE_OPERATION_MODE(
33888 AVSS_DRONE_OPERATION_MODE_DATA::random(rng),
33889 )),
33890 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
33891 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
33892 GLOBAL_POSITION_INT_DATA::random(rng),
33893 )),
33894 PARAM_EXT_VALUE_DATA::ID => {
33895 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
33896 }
33897 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
33898 MOUNT_ORIENTATION_DATA::ID => {
33899 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
33900 }
33901 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
33902 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
33903 GENERATOR_STATUS_DATA::ID => {
33904 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
33905 }
33906 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
33907 PARAM_EXT_REQUEST_READ_DATA::random(rng),
33908 )),
33909 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
33910 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
33911 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
33912 SAFETY_ALLOWED_AREA_DATA::random(rng),
33913 )),
33914 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
33915 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
33916 RC_CHANNELS_OVERRIDE_DATA::random(rng),
33917 )),
33918 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
33919 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
33920 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
33921 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
33922 UAVCAN_NODE_STATUS_DATA::random(rng),
33923 )),
33924 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
33925 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
33926 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
33927 ))
33928 }
33929 MISSION_CURRENT_DATA::ID => {
33930 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
33931 }
33932 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
33933 EXTENDED_SYS_STATE_DATA::random(rng),
33934 )),
33935 LOG_REQUEST_DATA_DATA::ID => {
33936 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
33937 }
33938 MESSAGE_INTERVAL_DATA::ID => {
33939 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
33940 }
33941 CAN_FILTER_MODIFY_DATA::ID => {
33942 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
33943 }
33944 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
33945 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
33946 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
33947 )),
33948 GPS_INJECT_DATA_DATA::ID => {
33949 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
33950 }
33951 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
33952 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
33953 COMPONENT_INFORMATION_DATA::random(rng),
33954 )),
33955 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
33956 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
33957 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
33958 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
33959 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
33960 OBSTACLE_DISTANCE_DATA::ID => {
33961 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
33962 }
33963 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
33964 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
33965 )),
33966 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
33967 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
33968 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
33969 HIL_STATE_QUATERNION_DATA::random(rng),
33970 )),
33971 PROTOCOL_VERSION_DATA::ID => {
33972 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
33973 }
33974 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
33975 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
33976 )),
33977 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
33978 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
33979 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
33980 )),
33981 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
33982 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
33983 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
33984 )),
33985 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
33986 COMPONENT_METADATA_DATA::random(rng),
33987 )),
33988 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
33989 CAMERA_CAPTURE_STATUS_DATA::random(rng),
33990 )),
33991 SET_HOME_POSITION_DATA::ID => {
33992 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
33993 }
33994 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
33995 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
33996 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
33997 )),
33998 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
33999 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
34000 VIDEO_STREAM_INFORMATION_DATA::random(rng),
34001 )),
34002 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
34003 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
34004 )),
34005 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34006 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
34007 )),
34008 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
34009 VICON_POSITION_ESTIMATE_DATA::random(rng),
34010 )),
34011 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
34012 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
34013 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
34014 )),
34015 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
34016 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
34017 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
34018 LOGGING_DATA_ACKED_DATA::random(rng),
34019 )),
34020 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
34021 SET_ATTITUDE_TARGET_DATA::random(rng),
34022 )),
34023 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34024 ATTITUDE_QUATERNION_DATA::random(rng),
34025 )),
34026 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
34027 FLIGHT_INFORMATION_DATA::random(rng),
34028 )),
34029 HIL_OPTICAL_FLOW_DATA::ID => {
34030 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
34031 }
34032 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
34033 VISION_SPEED_ESTIMATE_DATA::random(rng),
34034 )),
34035 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
34036 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
34037 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
34038 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
34039 )),
34040 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
34041 CAMERA_SETTINGS_DATA::ID => {
34042 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
34043 }
34044 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
34045 MISSION_REQUEST_LIST_DATA::random(rng),
34046 )),
34047 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34048 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
34049 )),
34050 RC_CHANNELS_RAW_DATA::ID => {
34051 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
34052 }
34053 LOG_REQUEST_LIST_DATA::ID => {
34054 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
34055 }
34056 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
34057 MISSION_REQUEST_DATA::ID => {
34058 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
34059 }
34060 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
34061 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
34062 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
34063 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
34064 RESOURCE_REQUEST_DATA::ID => {
34065 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
34066 }
34067 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
34068 DEBUG_FLOAT_ARRAY_DATA::ID => {
34069 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
34070 }
34071 LINK_NODE_STATUS_DATA::ID => {
34072 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
34073 }
34074 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
34075 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34076 CONTROL_SYSTEM_STATE_DATA::random(rng),
34077 )),
34078 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
34079 LOCAL_POSITION_NED_DATA::random(rng),
34080 )),
34081 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
34082 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
34083 ENCAPSULATED_DATA_DATA::ID => {
34084 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
34085 }
34086 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
34087 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
34088 )),
34089 HIL_RC_INPUTS_RAW_DATA::ID => {
34090 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
34091 }
34092 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
34093 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
34094 )),
34095 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
34096 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
34097 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
34098 SUPPORTED_TUNES_DATA::ID => {
34099 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
34100 }
34101 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
34102 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
34103 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
34104 PARAM_REQUEST_READ_DATA::random(rng),
34105 )),
34106 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
34107 NAMED_VALUE_INT_DATA::ID => {
34108 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
34109 }
34110 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34111 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
34112 )),
34113 MANUAL_SETPOINT_DATA::ID => {
34114 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
34115 }
34116 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
34117 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34118 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
34119 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
34120 ))
34121 }
34122 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34123 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
34124 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
34125 ))
34126 }
34127 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
34128 _ => None,
34129 }
34130 }
34131 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
34132 match self {
34133 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34134 Self::MISSION_COUNT(body) => body.ser(version, bytes),
34135 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
34136 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
34137 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
34138 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
34139 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
34140 Self::RC_CHANNELS(body) => body.ser(version, bytes),
34141 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
34142 Self::AUTH_KEY(body) => body.ser(version, bytes),
34143 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
34144 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
34145 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
34146 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
34147 Self::LOG_DATA(body) => body.ser(version, bytes),
34148 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
34149 Self::DEBUG(body) => body.ser(version, bytes),
34150 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
34151 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
34152 Self::EFI_STATUS(body) => body.ser(version, bytes),
34153 Self::COMMAND_ACK(body) => body.ser(version, bytes),
34154 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
34155 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
34156 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
34157 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
34158 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
34159 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
34160 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
34161 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
34162 Self::HEARTBEAT(body) => body.ser(version, bytes),
34163 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
34164 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
34165 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
34166 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
34167 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
34168 Self::EVENT(body) => body.ser(version, bytes),
34169 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
34170 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
34171 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
34172 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
34173 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
34174 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
34175 Self::STATUSTEXT(body) => body.ser(version, bytes),
34176 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
34177 Self::PLAY_TUNE(body) => body.ser(version, bytes),
34178 Self::MEMORY_VECT(body) => body.ser(version, bytes),
34179 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
34180 Self::FENCE_STATUS(body) => body.ser(version, bytes),
34181 Self::GPS_STATUS(body) => body.ser(version, bytes),
34182 Self::SCALED_IMU(body) => body.ser(version, bytes),
34183 Self::LOGGING_DATA(body) => body.ser(version, bytes),
34184 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
34185 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
34186 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
34187 Self::COMMAND_LONG(body) => body.ser(version, bytes),
34188 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
34189 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
34190 Self::RAW_IMU(body) => body.ser(version, bytes),
34191 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
34192 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
34193 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
34194 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
34195 Self::VFR_HUD(body) => body.ser(version, bytes),
34196 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
34197 Self::WINCH_STATUS(body) => body.ser(version, bytes),
34198 Self::ESC_INFO(body) => body.ser(version, bytes),
34199 Self::AVSS_PRS_SYS_STATUS(body) => body.ser(version, bytes),
34200 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
34201 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
34202 Self::RAW_RPM(body) => body.ser(version, bytes),
34203 Self::MISSION_ITEM(body) => body.ser(version, bytes),
34204 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
34205 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
34206 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
34207 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
34208 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
34209 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
34210 Self::ODOMETRY(body) => body.ser(version, bytes),
34211 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
34212 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
34213 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
34214 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
34215 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
34216 Self::WIND_COV(body) => body.ser(version, bytes),
34217 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
34218 Self::LANDING_TARGET(body) => body.ser(version, bytes),
34219 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
34220 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
34221 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
34222 Self::AIS_VESSEL(body) => body.ser(version, bytes),
34223 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
34224 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
34225 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
34226 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
34227 Self::AVSS_DRONE_POSITION(body) => body.ser(version, bytes),
34228 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
34229 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
34230 Self::V2_EXTENSION(body) => body.ser(version, bytes),
34231 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
34232 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
34233 Self::HOME_POSITION(body) => body.ser(version, bytes),
34234 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
34235 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
34236 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
34237 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
34238 Self::AVSS_DRONE_IMU(body) => body.ser(version, bytes),
34239 Self::BATTERY_INFO(body) => body.ser(version, bytes),
34240 Self::SET_MODE(body) => body.ser(version, bytes),
34241 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
34242 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
34243 Self::GPS2_RAW(body) => body.ser(version, bytes),
34244 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
34245 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
34246 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
34247 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
34248 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
34249 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
34250 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
34251 Self::LOGGING_ACK(body) => body.ser(version, bytes),
34252 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
34253 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
34254 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
34255 Self::HIL_GPS(body) => body.ser(version, bytes),
34256 Self::ALTITUDE(body) => body.ser(version, bytes),
34257 Self::AVSS_DRONE_OPERATION_MODE(body) => body.ser(version, bytes),
34258 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
34259 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
34260 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
34261 Self::PING(body) => body.ser(version, bytes),
34262 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
34263 Self::HIL_STATE(body) => body.ser(version, bytes),
34264 Self::CAN_FRAME(body) => body.ser(version, bytes),
34265 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
34266 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
34267 Self::PARAM_VALUE(body) => body.ser(version, bytes),
34268 Self::COLLISION(body) => body.ser(version, bytes),
34269 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
34270 Self::DEBUG_VECT(body) => body.ser(version, bytes),
34271 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
34272 Self::GPS_INPUT(body) => body.ser(version, bytes),
34273 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
34274 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
34275 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
34276 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
34277 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
34278 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
34279 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
34280 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
34281 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
34282 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
34283 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
34284 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
34285 Self::GPS2_RTK(body) => body.ser(version, bytes),
34286 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
34287 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
34288 Self::TIMESYNC(body) => body.ser(version, bytes),
34289 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
34290 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
34291 Self::CANFD_FRAME(body) => body.ser(version, bytes),
34292 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
34293 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
34294 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
34295 Self::MISSION_ACK(body) => body.ser(version, bytes),
34296 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
34297 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
34298 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
34299 Self::HIL_SENSOR(body) => body.ser(version, bytes),
34300 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
34301 Self::ESC_STATUS(body) => body.ser(version, bytes),
34302 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
34303 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
34304 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
34305 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
34306 Self::LOG_ENTRY(body) => body.ser(version, bytes),
34307 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
34308 Self::GPS_RTK(body) => body.ser(version, bytes),
34309 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
34310 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
34311 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
34312 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34313 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
34314 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
34315 Self::ATTITUDE(body) => body.ser(version, bytes),
34316 Self::COMMAND_INT(body) => body.ser(version, bytes),
34317 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
34318 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
34319 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
34320 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
34321 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
34322 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
34323 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
34324 Self::SIM_STATE(body) => body.ser(version, bytes),
34325 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
34326 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
34327 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
34328 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
34329 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
34330 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
34331 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
34332 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
34333 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
34334 Self::LOG_ERASE(body) => body.ser(version, bytes),
34335 Self::TUNNEL(body) => body.ser(version, bytes),
34336 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
34337 Self::SYS_STATUS(body) => body.ser(version, bytes),
34338 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
34339 Self::VIBRATION(body) => body.ser(version, bytes),
34340 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
34341 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
34342 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
34343 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
34344 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
34345 Self::DATA_STREAM(body) => body.ser(version, bytes),
34346 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
34347 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
34348 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
34349 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
34350 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
34351 Self::RADIO_STATUS(body) => body.ser(version, bytes),
34352 Self::SCALED_IMU2(body) => body.ser(version, bytes),
34353 Self::FUEL_STATUS(body) => body.ser(version, bytes),
34354 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
34355 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
34356 Self::POWER_STATUS(body) => body.ser(version, bytes),
34357 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
34358 Self::SCALED_IMU3(body) => body.ser(version, bytes),
34359 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
34360 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
34361 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
34362 Self::PARAM_SET(body) => body.ser(version, bytes),
34363 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
34364 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
34365 Self::CURRENT_MODE(body) => body.ser(version, bytes),
34366 }
34367 }
34368 fn extra_crc(id: u32) -> u8 {
34369 match id {
34370 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
34371 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
34372 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
34373 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
34374 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
34375 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
34376 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
34377 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
34378 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
34379 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
34380 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
34381 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
34382 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
34383 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
34384 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
34385 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
34386 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
34387 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
34388 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
34389 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
34390 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
34391 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
34392 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
34393 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
34394 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
34395 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
34396 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
34397 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
34398 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
34399 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
34400 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
34401 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
34402 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
34403 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
34404 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
34405 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
34406 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
34407 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
34408 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
34409 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
34410 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
34411 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
34412 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
34413 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
34414 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
34415 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
34416 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
34417 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
34418 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
34419 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
34420 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
34421 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
34422 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
34423 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
34424 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
34425 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
34426 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
34427 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
34428 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
34429 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
34430 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
34431 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
34432 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
34433 }
34434 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
34435 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
34436 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
34437 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
34438 AVSS_PRS_SYS_STATUS_DATA::ID => AVSS_PRS_SYS_STATUS_DATA::EXTRA_CRC,
34439 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
34440 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
34441 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
34442 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
34443 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
34444 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
34445 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
34446 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
34447 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
34448 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
34449 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
34450 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
34451 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
34452 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
34453 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
34454 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
34455 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
34456 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
34457 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
34458 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
34459 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
34460 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
34461 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
34462 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
34463 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
34464 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
34465 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
34466 AVSS_DRONE_POSITION_DATA::ID => AVSS_DRONE_POSITION_DATA::EXTRA_CRC,
34467 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
34468 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
34469 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
34470 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
34471 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
34472 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
34473 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
34474 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
34475 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
34476 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
34477 AVSS_DRONE_IMU_DATA::ID => AVSS_DRONE_IMU_DATA::EXTRA_CRC,
34478 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
34479 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
34480 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
34481 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
34482 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
34483 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
34484 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
34485 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34486 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
34487 }
34488 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34489 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
34490 }
34491 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
34492 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
34493 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34494 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
34495 }
34496 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
34497 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
34498 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
34499 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
34500 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
34501 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
34502 AVSS_DRONE_OPERATION_MODE_DATA::ID => AVSS_DRONE_OPERATION_MODE_DATA::EXTRA_CRC,
34503 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
34504 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
34505 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
34506 PING_DATA::ID => PING_DATA::EXTRA_CRC,
34507 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
34508 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
34509 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
34510 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
34511 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
34512 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
34513 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
34514 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
34515 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
34516 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
34517 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
34518 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
34519 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
34520 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
34521 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34522 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
34523 }
34524 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
34525 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
34526 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
34527 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
34528 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
34529 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
34530 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
34531 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
34532 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
34533 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
34534 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
34535 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
34536 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
34537 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
34538 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
34539 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
34540 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
34541 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
34542 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
34543 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
34544 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
34545 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
34546 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
34547 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
34548 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
34549 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
34550 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
34551 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
34552 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
34553 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
34554 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
34555 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
34556 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
34557 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
34558 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
34559 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
34560 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
34561 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
34562 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
34563 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
34564 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
34565 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
34566 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
34567 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
34568 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
34569 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
34570 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
34571 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
34572 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
34573 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
34574 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
34575 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
34576 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
34577 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
34578 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
34579 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
34580 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
34581 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
34582 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
34583 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
34584 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
34585 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
34586 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
34587 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
34588 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
34589 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
34590 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
34591 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
34592 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
34593 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
34594 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
34595 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
34596 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
34597 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
34598 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
34599 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
34600 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
34601 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
34602 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
34603 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
34604 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
34605 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
34606 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
34607 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
34608 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
34609 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
34610 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34611 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
34612 }
34613 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34614 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
34615 }
34616 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
34617 _ => 0,
34618 }
34619 }
34620 fn target_system_id(&self) -> Option<u8> {
34621 match self {
34622 Self::MISSION_COUNT(inner) => Some(inner.target_system),
34623 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
34624 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
34625 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
34626 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
34627 Self::COMMAND_ACK(inner) => Some(inner.target_system),
34628 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
34629 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
34630 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
34631 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
34632 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
34633 Self::PLAY_TUNE(inner) => Some(inner.target_system),
34634 Self::LOGGING_DATA(inner) => Some(inner.target_system),
34635 Self::COMMAND_LONG(inner) => Some(inner.target_system),
34636 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
34637 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
34638 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
34639 Self::MISSION_ITEM(inner) => Some(inner.target_system),
34640 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
34641 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
34642 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
34643 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
34644 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
34645 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
34646 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
34647 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
34648 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
34649 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
34650 Self::V2_EXTENSION(inner) => Some(inner.target_system),
34651 Self::SET_MODE(inner) => Some(inner.target_system),
34652 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
34653 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
34654 Self::LOGGING_ACK(inner) => Some(inner.target_system),
34655 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
34656 Self::PING(inner) => Some(inner.target_system),
34657 Self::CAN_FRAME(inner) => Some(inner.target_system),
34658 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
34659 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
34660 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
34661 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
34662 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
34663 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
34664 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
34665 Self::TIMESYNC(inner) => Some(inner.target_system),
34666 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
34667 Self::CANFD_FRAME(inner) => Some(inner.target_system),
34668 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
34669 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
34670 Self::MISSION_ACK(inner) => Some(inner.target_system),
34671 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
34672 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
34673 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
34674 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
34675 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
34676 Self::COMMAND_INT(inner) => Some(inner.target_system),
34677 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
34678 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
34679 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
34680 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
34681 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
34682 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
34683 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
34684 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
34685 Self::LOG_ERASE(inner) => Some(inner.target_system),
34686 Self::TUNNEL(inner) => Some(inner.target_system),
34687 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
34688 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
34689 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
34690 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
34691 Self::PARAM_SET(inner) => Some(inner.target_system),
34692 _ => None,
34693 }
34694 }
34695 fn target_component_id(&self) -> Option<u8> {
34696 match self {
34697 Self::MISSION_COUNT(inner) => Some(inner.target_component),
34698 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
34699 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
34700 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
34701 Self::COMMAND_ACK(inner) => Some(inner.target_component),
34702 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
34703 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
34704 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
34705 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
34706 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
34707 Self::PLAY_TUNE(inner) => Some(inner.target_component),
34708 Self::LOGGING_DATA(inner) => Some(inner.target_component),
34709 Self::COMMAND_LONG(inner) => Some(inner.target_component),
34710 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
34711 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
34712 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
34713 Self::MISSION_ITEM(inner) => Some(inner.target_component),
34714 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
34715 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
34716 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
34717 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
34718 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
34719 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
34720 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
34721 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
34722 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
34723 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
34724 Self::V2_EXTENSION(inner) => Some(inner.target_component),
34725 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
34726 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
34727 Self::LOGGING_ACK(inner) => Some(inner.target_component),
34728 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
34729 Self::PING(inner) => Some(inner.target_component),
34730 Self::CAN_FRAME(inner) => Some(inner.target_component),
34731 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
34732 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
34733 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
34734 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
34735 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
34736 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
34737 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
34738 Self::TIMESYNC(inner) => Some(inner.target_component),
34739 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
34740 Self::CANFD_FRAME(inner) => Some(inner.target_component),
34741 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
34742 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
34743 Self::MISSION_ACK(inner) => Some(inner.target_component),
34744 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
34745 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
34746 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
34747 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
34748 Self::COMMAND_INT(inner) => Some(inner.target_component),
34749 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
34750 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
34751 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
34752 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
34753 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
34754 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
34755 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
34756 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
34757 Self::LOG_ERASE(inner) => Some(inner.target_component),
34758 Self::TUNNEL(inner) => Some(inner.target_component),
34759 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
34760 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
34761 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
34762 Self::PARAM_SET(inner) => Some(inner.target_component),
34763 _ => None,
34764 }
34765 }
34766}